iam4x / bobarr

🍿 The all-in-one alternative for Sonarr, Radarr, Jackett... with a VPN and running in docker
MIT License
1.54k stars 88 forks source link

fix: Ensure Seasons are set to Processed on Library scan #237

Closed lachlan2k closed 2 years ago

lachlan2k commented 2 years ago

The Problem

Currently, when existing TV Shows are imported by scan-library, every season gets stuck on "Searching", even though all files for that season are present:

image

This is because when tvEpisodeDAO.findOrCreate is called, it defaults to the SEARCHING state:

https://github.com/iam4x/bobarr/blob/1f24631adcdb227819c5850b88a462d5d0b3125a/packages/api/src/modules/jobs/processors/scan-library.processor.ts#L411-L414

The Solution

This PR addresses the issue by setting the state of seasons created during the scan process to PROCESSED.

iam4x commented 2 years ago

Thank you!