Skip to content

Commit

Permalink
fix: rename/move _after_ firing events
Browse files Browse the repository at this point in the history
to prevent the renaming/move from interrupting the
firing of the events or updating the imported date.
  • Loading branch information
revam committed Mar 14, 2024
1 parent 4620f70 commit 1971c87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Shoko.Server/Scheduling/Jobs/Shoko/ProcessFileJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public override async Task Process()
// Process and get the AniDB file entry.
var aniFile = await ProcessFile_AniDB();

// Rename and/or move the physical file(s) if needed.
_vlocal.Places.ForEach(a => { _vlPlaceService.RenameAndMoveAsRequired(a); });

// Check if an AniDB file is now available and if the cross-references changed.
var newXRefs = _vlocal.EpisodeCrossRefs
.Select(xref => xref.EpisodeID)
Expand All @@ -96,6 +93,9 @@ public override async Task Process()
var isUDPBanned = _udpConnectionHandler.IsBanned;
ShokoEventHandler.Instance.OnFileNotMatched(_vlocal.GetBestVideoLocalPlace(), _vlocal, autoMatchAttempts, hasXRefs, isUDPBanned);
}

// Rename and/or move the physical file(s) if needed.
_vlocal.Places.ForEach(a => { _vlPlaceService.RenameAndMoveAsRequired(a); });
}

private async Task<SVR_AniDB_File> ProcessFile_AniDB()
Expand Down

0 comments on commit 1971c87

Please sign in to comment.