Skip to content

Commit

Permalink
^⁠_⁠^
Browse files Browse the repository at this point in the history
  • Loading branch information
Nubuki-all committed Dec 23, 2024
1 parent e2c8e9d commit 2f3a2d8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 6 additions & 8 deletions bot/utils/ani_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = """
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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_
Expand Down
2 changes: 1 addition & 1 deletion bot/workers/handlers/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)`"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit 2f3a2d8

Please sign in to comment.