Skip to content

Commit

Permalink
refactor: db changes for syncing. (#113)
Browse files Browse the repository at this point in the history
fix: sync marking chapter unread when we do library update before syncing.

So this should have been 0 on insert instead of the current time on insert. Essentially this issue arises: https://discord.com/channels/1099009852791083058/1099009853864812708/1190022356060614756

Signed-off-by: KaiserBh <[email protected]>
  • Loading branch information
kaiserbh authored Jan 18, 2024
1 parent 6018aa9 commit e4a6565
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/src/main/sqldelight/tachiyomi/data/chapters.sq
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ WHERE _id IN :chapterIds;

insert:
INSERT INTO chapters(manga_id, url, name, scanlator, read, bookmark, last_page_read, chapter_number, source_order, date_fetch, date_upload, last_modified_at)
VALUES (:mangaId, :url, :name, :scanlator, :read, :bookmark, :lastPageRead, :chapterNumber, :sourceOrder, :dateFetch, :dateUpload, strftime('%s', 'now'));
VALUES (:mangaId, :url, :name, :scanlator, :read, :bookmark, :lastPageRead, :chapterNumber, :sourceOrder, :dateFetch, :dateUpload, 0);

update:
UPDATE chapters
Expand Down
2 changes: 1 addition & 1 deletion data/src/main/sqldelight/tachiyomi/data/mangas.sq
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ AND source IN :sourceIds;

insert:
INSERT INTO mangas(source, url, artist, author, description, genre, title, status, thumbnail_url, favorite, last_update, next_update, initialized, viewer, chapter_flags, cover_last_modified, date_added, update_strategy, calculate_interval, last_modified_at)
VALUES (:source, :url, :artist, :author, :description, :genre, :title, :status, :thumbnailUrl, :favorite, :lastUpdate, :nextUpdate, :initialized, :viewerFlags, :chapterFlags, :coverLastModified, :dateAdded, :updateStrategy, :calculateInterval, strftime('%s', 'now'));
VALUES (:source, :url, :artist, :author, :description, :genre, :title, :status, :thumbnailUrl, :favorite, :lastUpdate, :nextUpdate, :initialized, :viewerFlags, :chapterFlags, :coverLastModified, :dateAdded, :updateStrategy, :calculateInterval, 0);

update:
UPDATE mangas SET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ END;

insert:
INSERT INTO mangas_categories(manga_id, category_id, last_modified_at)
VALUES (:mangaId, :categoryId, strftime('%s', 'now'));
VALUES (:mangaId, :categoryId, 0);

deleteMangaCategoryByMangaId:
DELETE FROM mangas_categories
Expand Down

0 comments on commit e4a6565

Please sign in to comment.