mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-02 12:26:36 +08:00
fix: keep existing library files in place
This commit is contained in:
@@ -276,6 +276,9 @@ func (r *MediaRepository) Upsert(ctx context.Context, m *model.Media) error {
|
||||
if m.EpisodeNum > 0 && existing.EpisodeNum != m.EpisodeNum {
|
||||
updates["episode_num"] = m.EpisodeNum
|
||||
}
|
||||
if m.STRMURL != "" {
|
||||
updates["strm_url"] = m.STRMURL
|
||||
}
|
||||
|
||||
if err := r.db.WithContext(ctx).Unscoped().Model(&model.Media{}).
|
||||
Where("id = ?", existing.ID).Updates(updates).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user