Skip to content

Commit

Permalink
manual episode title handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Dec 16, 2024
1 parent 004306e commit acc8c03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def parse(self, args, meta):
parser.add_argument('-edition', '--edition', '--repack', nargs='*', required=False, help="Edition/Repack String e.g.(Director's Cut, Uncut, Hybrid, REPACK, REPACK3)", type=str, dest='manual_edition', default=None)
parser.add_argument('-season', '--season', nargs='*', required=False, help="Season (number)", type=str)
parser.add_argument('-episode', '--episode', nargs='*', required=False, help="Episode (number)", type=str)
parser.add_argument('-met', '--manual-episode-title', nargs=1, required=False, help="Set episode title, empty = empty", type=datetime.date.fromisoformat, dest="manual_episode_title")
parser.add_argument('-daily', '--daily', nargs=1, required=False, help="Air date of this episode (YYYY-MM-DD)", type=datetime.date.fromisoformat, dest="manual_date")
parser.add_argument('--no-season', dest='no_season', action='store_true', required=False, help="Remove Season from title")
parser.add_argument('--no-year', dest='no_year', action='store_true', required=False, help="Remove Year from title")
Expand Down Expand Up @@ -242,6 +243,8 @@ def parse(self, args, meta):
meta[key] = 100
elif key in ("tag") and value == []:
meta[key] = ""
elif key in ["manual_episode_title"]:
meta[key] = value if value else ""
else:
meta[key] = meta.get(key, None)
if key in ('trackers'):
Expand Down
5 changes: 4 additions & 1 deletion src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -3414,7 +3414,10 @@ async def get_name(self, meta):
source = meta.get('source', "")
uhd = meta.get('uhd', "")
hdr = meta.get('hdr', "")
episode_title = meta.get('episode_title', '')
if meta.get('manual_episode_title'):
episode_title = meta.get('manual_episode_title')
else:
episode_title = meta.get('episode_title', '')
if meta.get('is_disc', "") == "BDMV": # Disk
video_codec = meta.get('video_codec', "")
region = meta.get('region', "")
Expand Down

0 comments on commit acc8c03

Please sign in to comment.