mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Minor tracking cleanups
This commit is contained in:
		@@ -7,7 +7,6 @@ import tachiyomi.domain.track.model.Track
 | 
			
		||||
@Serializable
 | 
			
		||||
data class BackupTracking(
 | 
			
		||||
    // in 1.x some of these values have different types or names
 | 
			
		||||
    // syncId is called siteId in 1,x
 | 
			
		||||
    @ProtoNumber(1) var syncId: Int,
 | 
			
		||||
    // LibraryId is not null in 1.x
 | 
			
		||||
    @ProtoNumber(2) var libraryId: Long,
 | 
			
		||||
@@ -34,7 +33,7 @@ data class BackupTracking(
 | 
			
		||||
        return Track(
 | 
			
		||||
            id = -1,
 | 
			
		||||
            mangaId = -1,
 | 
			
		||||
            syncId = this@BackupTracking.syncId.toLong(),
 | 
			
		||||
            trackerId = this@BackupTracking.syncId.toLong(),
 | 
			
		||||
            remoteId = if (this@BackupTracking.mediaIdInt != 0) {
 | 
			
		||||
                this@BackupTracking.mediaIdInt.toLong()
 | 
			
		||||
            } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,9 +8,9 @@ class DeleteTrack(
 | 
			
		||||
    private val trackRepository: TrackRepository,
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
    suspend fun await(mangaId: Long, syncId: Long) {
 | 
			
		||||
    suspend fun await(mangaId: Long, trackerId: Long) {
 | 
			
		||||
        try {
 | 
			
		||||
            trackRepository.delete(mangaId, syncId)
 | 
			
		||||
            trackRepository.delete(mangaId, trackerId)
 | 
			
		||||
        } catch (e: Exception) {
 | 
			
		||||
            logcat(LogPriority.ERROR, e)
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package tachiyomi.domain.track.model
 | 
			
		||||
data class Track(
 | 
			
		||||
    val id: Long,
 | 
			
		||||
    val mangaId: Long,
 | 
			
		||||
    val syncId: Long,
 | 
			
		||||
    val trackerId: Long,
 | 
			
		||||
    val remoteId: Long,
 | 
			
		||||
    val libraryId: Long?,
 | 
			
		||||
    val title: String,
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ interface TrackRepository {
 | 
			
		||||
 | 
			
		||||
    fun getTracksByMangaIdAsFlow(mangaId: Long): Flow<List<Track>>
 | 
			
		||||
 | 
			
		||||
    suspend fun delete(mangaId: Long, syncId: Long)
 | 
			
		||||
    suspend fun delete(mangaId: Long, trackerId: Long)
 | 
			
		||||
 | 
			
		||||
    suspend fun insert(track: Track)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user