mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-09 05:18:03 +08:00
Category/Tag not mandatory for -r and -ro
This commit is contained in:
parent
7cacfef260
commit
22c3e102c7
1 changed files with 20 additions and 11 deletions
|
@ -136,23 +136,31 @@ def trunc_val(s, d, n=3):
|
||||||
|
|
||||||
|
|
||||||
def get_category(path):
|
def get_category(path):
|
||||||
|
if 'cat' in cfg and cfg["cat"] != None:
|
||||||
cat_path = cfg["cat"]
|
cat_path = cfg["cat"]
|
||||||
for i, f in cat_path.items():
|
for i, f in cat_path.items():
|
||||||
if f in path:
|
if f in path:
|
||||||
category = i
|
category = i
|
||||||
return category
|
return category
|
||||||
|
else:
|
||||||
|
category = ''
|
||||||
|
return category
|
||||||
category = ''
|
category = ''
|
||||||
logger.warning('No categories matched. Check your config.yml file. - Setting category to NULL')
|
logger.warning('No categories matched. Check your config.yml file. - Setting category to NULL')
|
||||||
return category
|
return category
|
||||||
|
|
||||||
|
|
||||||
def get_tags(urls):
|
def get_tags(urls):
|
||||||
|
if 'tags' in cfg and cfg["tags"] != None:
|
||||||
tag_path = cfg['tags']
|
tag_path = cfg['tags']
|
||||||
for i, f in tag_path.items():
|
for i, f in tag_path.items():
|
||||||
for url in urls:
|
for url in urls:
|
||||||
if i in url:
|
if i in url:
|
||||||
tag = f
|
tag = f
|
||||||
if tag: return tag,trunc_val(url, '/')
|
if tag: return tag,trunc_val(url, '/')
|
||||||
|
else:
|
||||||
|
tag = ('','')
|
||||||
|
return tag
|
||||||
tag = ('','')
|
tag = ('','')
|
||||||
logger.warning('No tags matched. Check your config.yml file. Setting tag to NULL')
|
logger.warning('No tags matched. Check your config.yml file. Setting tag to NULL')
|
||||||
return tag
|
return tag
|
||||||
|
@ -430,6 +438,7 @@ def rem_unregistered():
|
||||||
logger.info('No unregistered torrents found.')
|
logger.info('No unregistered torrents found.')
|
||||||
if (len(pot_unr) > 0):
|
if (len(pot_unr) > 0):
|
||||||
logger.debug(f'Potential Unregistered torrents: {pot_unr}')
|
logger.debug(f'Potential Unregistered torrents: {pot_unr}')
|
||||||
|
|
||||||
def rem_orphaned():
|
def rem_orphaned():
|
||||||
if args.rem_orphaned == 'rem_orphaned':
|
if args.rem_orphaned == 'rem_orphaned':
|
||||||
torrent_list = client.torrents.info()
|
torrent_list = client.torrents.info()
|
||||||
|
|
Loading…
Add table
Reference in a new issue