Skip to content

Commit

Permalink
improve the contribution workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdzumair committed Jan 20, 2025
1 parent 18c5b5e commit 35f15c0
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions scrapers/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,6 @@ async def add_torrent(
}
)

# Year validation
if torrent_data.get("year") != movie_data.year and not force_import:
validation_errors.append(
{
"type": "year_mismatch",
"message": f"Year mismatch: '{movie_data.year}' != '{torrent_data.get('year')}'",
}
)

if validation_errors:
torrent_data.pop("torrent_file", None)
return {
Expand Down Expand Up @@ -755,13 +746,8 @@ async def analyze_torrent(
title = title.replace(date_str, "").strip()

# cleanup title
title = (
title.replace(".torrent", "")
.replace(".", " ")
.replace("-", " ")
.replace("_", " ")
.replace("H264", "")
)
title = re.sub(r"h264|.torrent", "", title, flags=re.IGNORECASE)
title = title.replace(".", " ").replace("-", " ").replace("_", " ")
title = re.sub(r"\s+", " ", title).strip()
title += f" {date_str}"
torrent_data["title"] = title
Expand Down

0 comments on commit 35f15c0

Please sign in to comment.