mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-04 12:36:37 +08:00
fix: correct organize media type classification
This commit is contained in:
@@ -210,10 +210,15 @@ func (o *OrganizerService) updateReclassifiedMediaRow(ctx context.Context, oldPa
|
||||
if req.Year > 0 {
|
||||
updates["year"] = req.Year
|
||||
}
|
||||
if req.Season > 0 {
|
||||
if normalizeOrganizeMediaType(req.MediaType) == "movie" {
|
||||
updates["season_num"] = 0
|
||||
updates["episode_num"] = 0
|
||||
} else if req.Season > 0 {
|
||||
updates["season_num"] = req.Season
|
||||
}
|
||||
if req.Episode > 0 {
|
||||
if req.Episode > 0 {
|
||||
updates["episode_num"] = req.Episode
|
||||
}
|
||||
} else if req.Episode > 0 {
|
||||
updates["episode_num"] = req.Episode
|
||||
}
|
||||
return o.repo.DB.WithContext(ctx).Model(&model.Media{}).Where("path = ?", oldPath).Updates(updates).Error
|
||||
|
||||
Reference in New Issue
Block a user