mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	Move LibraryManga to domain layer (#8126)
				
					
				
			This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| package eu.kanade.data.manga | ||||
|  | ||||
| import eu.kanade.domain.library.model.LibraryManga | ||||
| import eu.kanade.domain.manga.model.Manga | ||||
| import eu.kanade.tachiyomi.data.database.models.LibraryManga | ||||
| import eu.kanade.tachiyomi.source.model.UpdateStrategy | ||||
|  | ||||
| val mangaMapper: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long, UpdateStrategy) -> Manga = | ||||
| @@ -29,28 +29,31 @@ val mangaMapper: (Long, Long, String, String?, String?, String?, List<String>?, | ||||
|     } | ||||
|  | ||||
| val libraryManga: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long, UpdateStrategy, Long, Long, Long) -> LibraryManga = | ||||
|     { _id, 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, unread_count, read_count, category -> | ||||
|         LibraryManga().apply { | ||||
|             this.id = _id | ||||
|             this.source = source | ||||
|             this.url = url | ||||
|             this.artist = artist | ||||
|             this.author = author | ||||
|             this.description = description | ||||
|             this.genre = genre?.joinToString() | ||||
|             this.title = title | ||||
|             this.status = status.toInt() | ||||
|             this.thumbnail_url = thumbnail_url | ||||
|             this.favorite = favorite | ||||
|             this.last_update = last_update ?: 0 | ||||
|             this.update_strategy = update_strategy | ||||
|             this.initialized = initialized | ||||
|             this.viewer_flags = viewer.toInt() | ||||
|             this.chapter_flags = chapter_flags.toInt() | ||||
|             this.cover_last_modified = cover_last_modified | ||||
|             this.date_added = date_added | ||||
|             this.unreadCount = unread_count.toInt() | ||||
|             this.readCount = read_count.toInt() | ||||
|             this.category = category.toInt() | ||||
|         } | ||||
|     { _id, source, url, artist, author, description, genre, title, status, thumbnailUrl, favorite, lastUpdate, nextUpdate, initialized, viewerFlags, chapterFlags, coverLastModified, dateAdded, updateStrategy, unreadCount, readCount, category -> | ||||
|         LibraryManga( | ||||
|             manga = mangaMapper( | ||||
|                 _id, | ||||
|                 source, | ||||
|                 url, | ||||
|                 artist, | ||||
|                 author, | ||||
|                 description, | ||||
|                 genre, | ||||
|                 title, | ||||
|                 status, | ||||
|                 thumbnailUrl, | ||||
|                 favorite, | ||||
|                 lastUpdate, | ||||
|                 nextUpdate, | ||||
|                 initialized, | ||||
|                 viewerFlags, | ||||
|                 chapterFlags, | ||||
|                 coverLastModified, | ||||
|                 dateAdded, | ||||
|                 updateStrategy, | ||||
|             ), | ||||
|             category = category, | ||||
|             unreadCount = unreadCount, | ||||
|             readCount = readCount, | ||||
|         ) | ||||
|     } | ||||
|   | ||||
| @@ -3,10 +3,10 @@ package eu.kanade.data.manga | ||||
| import eu.kanade.data.DatabaseHandler | ||||
| import eu.kanade.data.listOfStringsAdapter | ||||
| import eu.kanade.data.updateStrategyAdapter | ||||
| import eu.kanade.domain.library.model.LibraryManga | ||||
| import eu.kanade.domain.manga.model.Manga | ||||
| import eu.kanade.domain.manga.model.MangaUpdate | ||||
| import eu.kanade.domain.manga.repository.MangaRepository | ||||
| import eu.kanade.tachiyomi.data.database.models.LibraryManga | ||||
| import eu.kanade.tachiyomi.util.system.logcat | ||||
| import eu.kanade.tachiyomi.util.system.toLong | ||||
| import kotlinx.coroutines.flow.Flow | ||||
|   | ||||
		Reference in New Issue
	
	Block a user