mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-14 00:56:37 +08:00
bug处理
bug处理
This commit is contained in:
@@ -248,11 +248,16 @@ func (s *ScraperService) applyLocalMetadataMatch(ctx context.Context, m *model.M
|
|||||||
if next.NSFW {
|
if next.NSFW {
|
||||||
updates["nsfw"] = true
|
updates["nsfw"] = true
|
||||||
}
|
}
|
||||||
if err := s.repo.DB.WithContext(ctx).Model(&model.Media{}).
|
if err := s.repo.DB.WithContext(ctx).Model(&model.Media{}).
|
||||||
Where("id = ?", m.ID).Updates(updates).Error; err != nil {
|
Where("id = ?", m.ID).Updates(updates).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s.invalidateMediaCache(ctx)
|
var lib *model.Library
|
||||||
|
if m != nil && s.repo != nil && s.repo.Library != nil {
|
||||||
|
lib, _ = s.repo.Library.FindByID(ctx, m.LibraryID)
|
||||||
|
}
|
||||||
|
s.writeMediaArtworkFilesAfterScrape(ctx, m, lib)
|
||||||
|
s.invalidateMediaCache(ctx)
|
||||||
s.hub.Publish("scrape", map[string]any{
|
s.hub.Publish("scrape", map[string]any{
|
||||||
"media_id": m.ID,
|
"media_id": m.ID,
|
||||||
"title": next.Title,
|
"title": next.Title,
|
||||||
|
|||||||
Reference in New Issue
Block a user