Skip to content

Commit

Permalink
Allow edit PTP description
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Aug 31, 2024
1 parent 7d7d948 commit 626f86c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/trackers/PTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import multiprocessing
import platform
import pickle
import click
from pymediainfo import MediaInfo
from src.trackers.COMMON import COMMON
from src.bbcode import BBCODE
Expand Down Expand Up @@ -184,10 +185,25 @@ async def get_ptp_description(self, ptp_torrent_id, is_disc):

bbcode = BBCODE()
desc, imagelist = bbcode.clean_ptp_description(ptp_desc, is_disc)

console.print(f"[bold green]Successfully grabbed description from PTP")
console.print(f"[cyan]Description after cleaning:[yellow]\n{desc[:500]}...") # Show first 500 characters for brevity

# Allow user to edit or discard the description
console.print("[cyan]Do you want to edit or discard the description?[/cyan]")
edit_choice = input("[cyan]Enter 'e' to edit, 'd' to discard, or press Enter to keep it as is: [/cyan]")

if edit_choice.lower() == 'e':
edited_description = click.edit(desc)
if edited_description:
desc = edited_description.strip()
console.print(f"[green]Final description after editing:[/green] {desc}")
elif edit_choice.lower() == 'd':
desc = None
console.print("[yellow]Description discarded.[/yellow]")
else:
console.print(f"[green]Keeping the original description.[/green]")

return desc, imagelist

async def get_group_by_imdb(self, imdb):
Expand Down

0 comments on commit 626f86c

Please sign in to comment.