Skip to content

Commit

Permalink
Lint clean recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Sep 1, 2024
1 parent 9f53833 commit 5d91932
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/bbcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self):

def clean_ptp_description(self, desc, is_disc):
# console.print(f"[yellow]Cleaning PTP description...")

# Convert Bullet Points to -
desc = desc.replace("•", "-")

Expand Down Expand Up @@ -150,7 +150,7 @@ def clean_ptp_description(self, desc, is_disc):
desc = desc.strip('\n')

if desc.replace('\n', '').strip() == '':
console.print(f"[yellow]Description is empty after cleaning.")
console.print("[yellow]Description is empty after cleaning.")
return "", imagelist

return desc, imagelist
Expand Down
24 changes: 12 additions & 12 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ async def update_metadata_from_tracker(self, tracker_name, tracker_instance, met
if blu_filename:
meta['blu_filename'] = blu_filename # Store the filename in meta for later use
found_match = True
console.print(f"[green]BLU data successfully updated in meta[/green]")
console.print("[green]BLU data successfully updated in meta[/green]")
else:
console.print(f"[yellow]Skipped {tracker_name}, moving to the next site.[/yellow]")
else:
console.print(f"[yellow]No valid data found on {tracker_name}[/yellow]")
else:
console.print(f"[yellow]No ID found in meta for BLU, searching by file name[/yellow]")
console.print("[yellow]No ID found in meta for BLU, searching by file name[/yellow]")
blu_tmdb, blu_imdb, blu_tvdb, blu_mal, blu_desc, blu_category, meta['ext_torrenthash'], blu_imagelist, blu_filename = await COMMON(self.config).unit3d_torrent_info(
"BLU",
tracker_instance.torrent_url,
Expand Down Expand Up @@ -164,7 +164,7 @@ async def update_metadata_from_tracker(self, tracker_name, tracker_instance, met
if blu_filename:
meta['blu_filename'] = blu_filename
found_match = True
console.print(f"[green]BLU data successfully updated in meta[/green]")
console.print("[green]BLU data successfully updated in meta[/green]")
else:
console.print(f"[yellow]Skipped {tracker_name}, moving to the next site.[/yellow]")
else:
Expand All @@ -177,7 +177,7 @@ async def update_metadata_from_tracker(self, tracker_name, tracker_instance, met
# console.print(f"[yellow]No PTP ID in meta, searching by search term[/yellow]")
imdb, ptp_torrent_id, meta['ext_torrenthash'] = await tracker_instance.get_ptp_id_imdb(search_term, search_file_folder)
if ptp_torrent_id:
meta['ptp'] = ptp_torrent_id
meta['ptp'] = ptp_torrent_id
meta['imdb'] = str(imdb).zfill(7) if imdb else None
else:
ptp_torrent_id = meta['ptp']
Expand All @@ -201,13 +201,13 @@ async def update_metadata_from_tracker(self, tracker_name, tracker_instance, met
if meta.get('image_list'):
await self.handle_image_list(meta, tracker_name)
meta['skip_gen_desc'] = True
console.print(f"[green]PTP description and images added to metadata.[/green]")
console.print("[green]PTP description and images added to metadata.[/green]")

if await self.prompt_user_for_confirmation("Do you want to keep the description from PTP?"):
meta['skip_gen_desc'] = True
found_match = True
else:
console.print(f"[yellow]Description discarded from PTP[/yellow]")
console.print("[yellow]Description discarded from PTP[/yellow]")
meta['skip_gen_desc'] = True
meta['description'] = None
else:
Expand All @@ -218,20 +218,20 @@ async def update_metadata_from_tracker(self, tracker_name, tracker_instance, met
if meta.get('hdb') is not None:
meta[manual_key] = meta[tracker_key]
console.print(f"[cyan]{tracker_name} ID found in meta, reusing existing ID: {meta[tracker_key]}[/cyan]")

# Use get_info_from_torrent_id function if ID is found in meta
imdb, tvdb_id, hdb_name, meta['ext_torrenthash'] = await tracker_instance.get_info_from_torrent_id(meta[tracker_key])

meta['tvdb_id'] = str(tvdb_id) if tvdb_id else meta.get('tvdb_id')
meta['hdb_name'] = hdb_name
found_match = True

else:
console.print(f"[yellow]No ID found in meta for HDB, searching by file name[/yellow]")
console.print("[yellow]No ID found in meta for HDB, searching by file name[/yellow]")

# Use search_filename function if ID is not found in meta
imdb, tvdb_id, hdb_name, meta['ext_torrenthash'], tracker_id = await tracker_instance.search_filename(search_term, search_file_folder)

meta['tvdb_id'] = str(tvdb_id) if tvdb_id else meta.get('tvdb_id')
meta['hdb_name'] = hdb_name
if tracker_id:
Expand Down
4 changes: 2 additions & 2 deletions src/trackers/COMMON.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async def unit3d_torrent_info(self, tracker, torrent_url, search_url, id=None, f
description = None
console.print("[yellow]Description discarded.[/yellow]")
else:
console.print(f"[green]Keeping the original description.[/green]")
console.print("[green]Keeping the original description.[/green]")
else:
console.print(f"[yellow]No description found for {tracker}.[/yellow]")
else:
Expand Down Expand Up @@ -243,7 +243,7 @@ async def unit3d_torrent_info(self, tracker, torrent_url, search_url, id=None, f
description = None
console.print("[yellow]Description discarded.[/yellow]")
else:
console.print(f"[green]Keeping the original description.[/green]")
console.print("[green]Keeping the original description.[/green]")
else:
console.print(f"[yellow]No description found for {tracker}.[/yellow]")

Expand Down

0 comments on commit 5d91932

Please sign in to comment.