mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
don't set root is files in unique dir but still looking for cat. fix #185
This commit is contained in:
parent
d427d9df09
commit
c2af80dea0
1 changed files with 24 additions and 21 deletions
|
@ -54,10 +54,12 @@ def category_search(inputDirectory, inputName, inputCategory, root, categories):
|
||||||
|
|
||||||
categorySearch = [os.path.normpath(inputDirectory), ""] # initializie
|
categorySearch = [os.path.normpath(inputDirectory), ""] # initializie
|
||||||
notfound = 0
|
notfound = 0
|
||||||
|
unique = int(0)
|
||||||
for x in range(10): # loop up through 10 directories looking for category.
|
for x in range(10): # loop up through 10 directories looking for category.
|
||||||
try:
|
try:
|
||||||
categorySearch2 = os.path.split(os.path.normpath(categorySearch[0]))
|
categorySearch2 = os.path.split(os.path.normpath(categorySearch[0]))
|
||||||
except: # this might happen when we can't go higher.
|
except: # this might happen when we can't go higher.
|
||||||
|
if unique = int(0)
|
||||||
if inputCategory and inputName: # if these exists, we are ok to proceed, but assume we are in a root/common directory.
|
if inputCategory and inputName: # if these exists, we are ok to proceed, but assume we are in a root/common directory.
|
||||||
Logger.info("SEARCH: Could not find a category in the directory structure")
|
Logger.info("SEARCH: Could not find a category in the directory structure")
|
||||||
Logger.info("SEARCH: We will try and determine which files to process, individually")
|
Logger.info("SEARCH: We will try and determine which files to process, individually")
|
||||||
|
@ -123,6 +125,7 @@ def category_search(inputDirectory, inputName, inputCategory, root, categories):
|
||||||
break
|
break
|
||||||
elif inputName and safeName(categorySearch2[1]) == safeName(inputName): # we have identified a unique directory.
|
elif inputName and safeName(categorySearch2[1]) == safeName(inputName): # we have identified a unique directory.
|
||||||
Logger.info("SEARCH: Files appear to be in their own directory")
|
Logger.info("SEARCH: Files appear to be in their own directory")
|
||||||
|
unique = int(1)
|
||||||
if inputCategory: # we are ok to proceed.
|
if inputCategory: # we are ok to proceed.
|
||||||
break # we are done
|
break # we are done
|
||||||
else:
|
else:
|
||||||
|
@ -137,7 +140,7 @@ def category_search(inputDirectory, inputName, inputCategory, root, categories):
|
||||||
categorySearch = categorySearch2 # ready for next loop
|
categorySearch = categorySearch2 # ready for next loop
|
||||||
continue # keep going
|
continue # keep going
|
||||||
|
|
||||||
if notfound == 1:
|
if notfound == 1 and not unique = int(1):
|
||||||
if inputCategory and inputName: # if these exists, we are ok to proceed, but assume we are in a root/common directory.
|
if inputCategory and inputName: # if these exists, we are ok to proceed, but assume we are in a root/common directory.
|
||||||
Logger.info("SEARCH: Could not find a category in the directory structure")
|
Logger.info("SEARCH: Could not find a category in the directory structure")
|
||||||
Logger.info("SEARCH: We will try and determine which files to process, individually")
|
Logger.info("SEARCH: We will try and determine which files to process, individually")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue