diff --git a/bot/__init__.py b/bot/__init__.py index 948dcad..d51adfb 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -73,7 +73,7 @@ parse_file = "NO_PARSE" qb_lock = asyncio.Lock() queue_lock = asyncio.Lock() -rename_file = "Auto-rename.txt" +rename_file = "filters/Auto-rename.txt" rss_dict_lock = asyncio.Lock() thumb = "thumb.jpg" version_file = "version.txt" diff --git a/bot/utils/ani_utils.py b/bot/utils/ani_utils.py index 41b7ff4..a0318ed 100644 --- a/bot/utils/ani_utils.py +++ b/bot/utils/ani_utils.py @@ -8,7 +8,7 @@ import humanize import pycountry -from bot import _bot, conf, ffmpeg_file, parse_file, release_name, release_name_b +from bot import _bot, conf, filter_file, ffmpeg_file, parse_file, release_name, release_name_b, rename_file from .bot_utils import ( auto_rename, @@ -24,8 +24,6 @@ from .log_utils import log, logger from .os_utils import check_ext, file_exists, get_stream_info, info, p_dl -ar_file = "Auto-rename.txt" -filter_file = "filter.txt" url = "https://graphql.anilist.co" anime_query = """ @@ -424,7 +422,7 @@ async def parse( f_title = title re_title = f_title - ar = txt_to_str(ar_file) + ar = txt_to_str(rename_file) f_title = await auto_rename(f_title, or_title, ar) title = f_title if re_title != f_title else title @@ -493,7 +491,7 @@ async def dynamicthumb(name, thum="thumb2.jpg", anilist=True, _filter=None): # release group rg = parsed.get("release_group") - ar = txt_to_str(ar_file) + ar = txt_to_str(rename_file) tparse, title_ = await auto_rename(title, title, ar, general=True) anilist = False if not tparse else anilist title = title_ @@ -619,7 +617,7 @@ async def custcap( log(Exception) title = string.capwords(title) - ar = txt_to_str(ar_file) + ar = txt_to_str(rename_file) title = await auto_rename(title, or_title, ar, caption=True) crc32s, mi = None, None if file_exists(out): @@ -743,7 +741,7 @@ async def simplecap( pass title = string.capwords(title) - ar = txt_to_str(ar_file) + ar = txt_to_str(rename_file) title = await auto_rename(title, or_title, ar, caption=True) crc32s, mi = None, None if file_exists(out): @@ -841,7 +839,7 @@ async def f_post( if sn == "1": sn = None - ar = txt_to_str(ar_file) + ar = txt_to_str(rename_file) tparse, title_ = await auto_rename(title, title, ar, general=True) anilist = False if not tparse else anilist title = title_ diff --git a/bot/workers/handlers/manage.py b/bot/workers/handlers/manage.py index 6f63ba1..e77f955 100644 --- a/bot/workers/handlers/manage.py +++ b/bot/workers/handlers/manage.py @@ -634,7 +634,7 @@ async def auto_rename(event, args, client): Example : /name My Little Puppy|MLP|0 - All files with My Little Puppy get renamed to MLP. - Caption is ignored and normal settings apply. - For more examples see Auto-rename.txt. + For more examples see filters/Auto-rename.txt. """ fail_msg = ( "failed…\n**Try:**\n/name " "`(Add_name_to_check_for|Add_name_to_replace_with)`" diff --git a/Auto-rename.txt b/filters/Auto-rename.txt similarity index 100% rename from Auto-rename.txt rename to filters/Auto-rename.txt diff --git a/update.py b/update.py index 080f3d7..e3b2d51 100644 --- a/update.py +++ b/update.py @@ -35,7 +35,7 @@ def update(): default="https://github.com/Nubuki-all/Enc") UPSTREAM_BRANCH = config("UPSTREAM_BRANCH", default="main") - r_filep = Path("Auto-rename.txt") + r_filep = Path("filters/Auto-rename.txt") rvars = varsgetter(r_filep) update_check = Path("update") cmd = (