Skip to content

Commit

Permalink
fix meta id handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Feb 16, 2025
1 parent 8badc85 commit a3ec7ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/trackermeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ async def update_meta_with_unit3d_data(meta, tracker_data, tracker_name):
if meta['debug']:
console.print("set TMDB ID:", meta['tmdb_manual'])
if imdb not in [None, '0']:
meta['imdb'] = str(imdb).zfill(7)
meta['imdb_id'] = str(imdb).zfill(7)
if meta['debug']:
console.print("set IMDB ID:", meta['imdb'])
console.print("set IMDB ID:", meta['imdb_id'])
if tvdb not in [None, '0']:
meta['tvdb_id'] = tvdb
if mal not in [None, '0']:
meta['mal'] = mal
meta['mal_id'] = mal
if desc not in [None, '0', '']:
meta['description'] = desc
with open(f"{meta['base_dir']}/tmp/{meta['uuid']}/DESCRIPTION.txt", 'w', newline="", encoding='utf8') as description:
Expand Down Expand Up @@ -215,8 +215,8 @@ async def update_metadata_from_tracker(tracker_name, tracker_instance, meta, sea
if meta.get('ptp') is None:
imdb_id, ptp_torrent_id, ptp_torrent_hash = await tracker_instance.get_ptp_id_imdb(search_term, search_file_folder, meta)
if ptp_torrent_id:
meta['imdb'] = str(imdb_id).zfill(7) if imdb_id else None
console.print(f"[green]{tracker_name} IMDb ID found: tt{meta['imdb']}[/green]")
meta['imdb_id'] = str(imdb_id).zfill(7) if imdb_id else None
console.print(f"[green]{tracker_name} IMDb ID found: tt{meta['imdb_id']}[/green]")

if not meta['unattended']:
if await prompt_user_for_confirmation("Do you want to use this ID data from PTP?"):
Expand All @@ -237,7 +237,7 @@ async def update_metadata_from_tracker(tracker_name, tracker_instance, meta, sea

else:
found_match = False
meta['imdb'] = None
meta['imdb_id'] = None

else:
found_match = True
Expand All @@ -261,8 +261,8 @@ async def update_metadata_from_tracker(tracker_name, tracker_instance, meta, sea
console.print("[cyan]Using specified PTP ID to get IMDb ID[/cyan]")
imdb_id, _, meta['ext_torrenthash'] = await tracker_instance.get_imdb_from_torrent_id(ptp_torrent_id)
if imdb_id:
meta['imdb'] = str(imdb_id).zfill(7)
console.print(f"[green]IMDb ID found: tt{meta['imdb']}[/green]")
meta['imdb_id'] = str(imdb_id).zfill(7)
console.print(f"[green]IMDb ID found: tt{meta['imdb_id']}[/green]")
found_match = True
meta['skipit'] = True
if only_id is not True:
Expand Down

0 comments on commit a3ec7ad

Please sign in to comment.