Skip to content

Commit

Permalink
fix: Check deleted scenes while matchinf alt sources (xbapps#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Apr 2, 2024
1 parent d9c16a2 commit c033891
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/tasks/alternate_scene_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ func MatchAlternateSources() {
tmpAltSource.Save()
if len(searchResults.Hits) > 0 {
var scene models.Scene
scene.GetIfExist(searchResults.Hits[0].ID)
idx := 0
// check the scene found by search isn't deleted, ie scene.ID == 0
for idx < len(searchResults.Hits) && scene.ID == 0 {
scene.GetIfExist(searchResults.Hits[idx].ID)
idx += 1
}

if scene.ID > 0 {
// check not already linked, if we update unnessarily, it will mess up the sort by "Released on Alternate Sites" sort option
found := false
Expand Down

0 comments on commit c033891

Please sign in to comment.