mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-29 04:27:51 +02:00
Add user manga notes (#428)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@ -31,6 +31,7 @@ object MangaMapper {
|
||||
version: Long,
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
isSyncing: Long,
|
||||
notes: String,
|
||||
): Manga = Manga(
|
||||
id = id,
|
||||
source = source,
|
||||
@ -55,6 +56,7 @@ object MangaMapper {
|
||||
lastModifiedAt = lastModifiedAt,
|
||||
favoriteModifiedAt = favoriteModifiedAt,
|
||||
version = version,
|
||||
notes = notes,
|
||||
)
|
||||
|
||||
fun mapLibraryManga(
|
||||
@ -82,6 +84,7 @@ object MangaMapper {
|
||||
favoriteModifiedAt: Long?,
|
||||
version: Long,
|
||||
isSyncing: Long,
|
||||
notes: String,
|
||||
totalCount: Long,
|
||||
readCount: Double,
|
||||
latestUpload: Long,
|
||||
@ -115,6 +118,7 @@ object MangaMapper {
|
||||
favoriteModifiedAt,
|
||||
version,
|
||||
isSyncing,
|
||||
notes,
|
||||
),
|
||||
category = category,
|
||||
totalChapters = totalCount,
|
||||
|
@ -171,6 +171,7 @@ class MangaRepositoryImpl(
|
||||
updateStrategy = value.updateStrategy?.let(UpdateStrategyColumnAdapter::encode),
|
||||
version = value.version,
|
||||
isSyncing = 0,
|
||||
notes = value.notes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,8 @@ CREATE TABLE mangas(
|
||||
last_modified_at INTEGER NOT NULL DEFAULT 0,
|
||||
favorite_modified_at INTEGER,
|
||||
version INTEGER NOT NULL DEFAULT 0,
|
||||
is_syncing INTEGER NOT NULL DEFAULT 0
|
||||
is_syncing INTEGER NOT NULL DEFAULT 0,
|
||||
notes TEXT NOT NULL DEFAULT ""
|
||||
);
|
||||
|
||||
CREATE INDEX library_favorite_index ON mangas(favorite) WHERE favorite = 1;
|
||||
@ -175,7 +176,8 @@ UPDATE mangas SET
|
||||
update_strategy = coalesce(:updateStrategy, update_strategy),
|
||||
calculate_interval = coalesce(:calculateInterval, calculate_interval),
|
||||
version = coalesce(:version, version),
|
||||
is_syncing = coalesce(:isSyncing, is_syncing)
|
||||
is_syncing = coalesce(:isSyncing, is_syncing),
|
||||
notes = coalesce(:notes, notes)
|
||||
WHERE _id = :mangaId;
|
||||
|
||||
selectLastInsertedRowId:
|
||||
|
3
data/src/main/sqldelight/tachiyomi/migrations/5.sqm
Normal file
3
data/src/main/sqldelight/tachiyomi/migrations/5.sqm
Normal file
@ -0,0 +1,3 @@
|
||||
-- Add notes column
|
||||
ALTER TABLE mangas
|
||||
ADD notes TEXT NOT NULL DEFAULT "";
|
Reference in New Issue
Block a user