Commit 89b8c52
Jamie
fix: SonarrSync now deletes episodes per-series to prevent incomplete cache
Fixes #5306 - Sonarr items are not showing as available
Root cause:
SonarrSync was deleting ALL episodes from SonarrEpisodeCache at the start of
the job, then re-adding them one series at a time. If the job failed
partway through (API timeout, network issue, etc.), the cache would be
left incomplete with only some series' episodes. This caused shows to be
incorrectly marked as unavailable.
Changes:
- Moved DELETE FROM SonarrEpisodeCache inside the series loop
- Now deletes episodes per series (by TvDbId) before adding new ones
- If job fails mid-way, cache for already-processed series remains intact
This ensures that partial failures don't result in completely empty cache.1 parent bb6300f commit 89b8c52
1 file changed
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 95 | | |
103 | 96 | | |
104 | 97 | | |
| |||
111 | 104 | | |
112 | 105 | | |
113 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
0 commit comments