mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-27 19:47:51 +02:00
Update non-library manga data when browsing (#1967)
This commit is contained in:
@ -141,6 +141,9 @@ class MangaRepositoryImpl(
|
||||
dateAdded = it.dateAdded,
|
||||
updateStrategy = it.updateStrategy,
|
||||
version = it.version,
|
||||
updateTitle = it.title.isNotBlank(),
|
||||
updateCover = !it.thumbnailUrl.isNullOrBlank(),
|
||||
updateDetails = it.initialized,
|
||||
mapper = MangaMapper::mapManga,
|
||||
)
|
||||
.executeAsOne()
|
||||
|
@ -196,9 +196,18 @@ insertNetworkManga {
|
||||
:updateStrategy, :calculateInterval, 0, :version
|
||||
WHERE NOT EXISTS(SELECT 0 FROM mangas WHERE source = :source AND url = :url);
|
||||
|
||||
-- Update the title if it is not favorite
|
||||
-- Update the relevant details if applicable and not favorite
|
||||
UPDATE mangas
|
||||
SET title = :title
|
||||
SET
|
||||
title = CASE WHEN :updateTitle THEN :title ELSE title END,
|
||||
thumbnail_url = CASE WHEN :updateCover THEN :thumbnailUrl ELSE thumbnail_url END,
|
||||
author = CASE WHEN :updateDetails THEN :author ELSE author END,
|
||||
artist = CASE WHEN :updateDetails THEN :artist ELSE artist END,
|
||||
description = CASE WHEN :updateDetails THEN :description ELSE description END,
|
||||
genre = CASE WHEN :updateDetails THEN :genre ELSE genre END,
|
||||
status = CASE WHEN :updateDetails THEN :status ELSE status END,
|
||||
update_strategy = CASE WHEN :updateDetails THEN :updateStrategy ELSE update_strategy END,
|
||||
initialized = :updateDetails
|
||||
WHERE source = :source
|
||||
AND url = :url
|
||||
AND favorite = 0;
|
||||
|
Reference in New Issue
Block a user