Formatting.

Disable line length check in detekt. It's being guarded by KtLint already.
This commit is contained in:
tzugen 2022-07-05 15:30:41 +02:00
parent ad54db5bcb
commit 53a1a5545a
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
9 changed files with 14 additions and 17 deletions

View File

@ -9,7 +9,6 @@ package org.moire.ultrasonic.domain
import androidx.room.ColumnInfo import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey
import java.util.Date import java.util.Date
@Entity(tableName = "albums", primaryKeys = ["id", "serverId"]) @Entity(tableName = "albums", primaryKeys = ["id", "serverId"])

View File

@ -9,7 +9,6 @@ package org.moire.ultrasonic.domain
import androidx.room.ColumnInfo import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity(tableName = "artists", primaryKeys = ["id", "serverId"]) @Entity(tableName = "artists", primaryKeys = ["id", "serverId"])
data class Artist( data class Artist(

View File

@ -9,6 +9,7 @@ package org.moire.ultrasonic.domain
import androidx.room.Ignore import androidx.room.Ignore
@Suppress("LongParameterList")
abstract class ArtistOrIndex( abstract class ArtistOrIndex(
@Ignore @Ignore
override var id: String, override var id: String,

View File

@ -9,7 +9,6 @@ package org.moire.ultrasonic.domain
import androidx.room.ColumnInfo import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity(tableName = "indexes", primaryKeys = ["id", "serverId"]) @Entity(tableName = "indexes", primaryKeys = ["id", "serverId"])
data class Index( data class Index(

View File

@ -9,7 +9,6 @@ package org.moire.ultrasonic.domain
import androidx.room.ColumnInfo import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey
import java.io.Serializable import java.io.Serializable
import java.util.Date import java.util.Date

View File

@ -64,10 +64,7 @@ style:
WildcardImport: WildcardImport:
active: true active: true
MaxLineLength: MaxLineLength:
active: true active: false
maxLineLength: 120
excludePackageStatements: false
excludeImportStatements: false
MagicNumber: MagicNumber:
# 100 common in percentage, 1000 in milliseconds # 100 common in percentage, 1000 in milliseconds
ignoreNumbers: ['-1', '0', '1', '2', '5', '10', '100', '256', '512', '1000', '1024', '4096'] ignoreNumbers: ['-1', '0', '1', '2', '5', '10', '100', '256', '512', '1000', '1024', '4096']

View File

@ -14,12 +14,12 @@ import androidx.room.TypeConverter
import androidx.room.TypeConverters import androidx.room.TypeConverters
import androidx.room.migration.Migration import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase import androidx.sqlite.db.SupportSQLiteDatabase
import java.util.Date
import org.moire.ultrasonic.domain.Album import org.moire.ultrasonic.domain.Album
import org.moire.ultrasonic.domain.Artist import org.moire.ultrasonic.domain.Artist
import org.moire.ultrasonic.domain.Index import org.moire.ultrasonic.domain.Index
import org.moire.ultrasonic.domain.MusicFolder import org.moire.ultrasonic.domain.MusicFolder
import org.moire.ultrasonic.domain.Track import org.moire.ultrasonic.domain.Track
import java.util.Date
/** /**
* This database is used to store and cache the ID3 metadata * This database is used to store and cache the ID3 metadata
@ -67,6 +67,7 @@ class Converters {
} }
} }
/* ktlint-disable max-line-length */
val META_MIGRATION_2_3: Migration = object : Migration(2, 3) { val META_MIGRATION_2_3: Migration = object : Migration(2, 3) {
override fun migrate(database: SupportSQLiteDatabase) { override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("DROP TABLE `albums`") database.execSQL("DROP TABLE `albums`")
@ -81,3 +82,4 @@ val META_MIGRATION_2_3: Migration = object : Migration(2,3) {
database.execSQL("CREATE TABLE IF NOT EXISTS `tracks` (`id` TEXT NOT NULL, `serverId` INTEGER NOT NULL DEFAULT -1, `parent` TEXT, `isDirectory` INTEGER NOT NULL, `title` TEXT, `album` TEXT, `albumId` TEXT, `artist` TEXT, `artistId` TEXT, `track` INTEGER, `year` INTEGER, `genre` TEXT, `contentType` TEXT, `suffix` TEXT, `transcodedContentType` TEXT, `transcodedSuffix` TEXT, `coverArt` TEXT, `size` INTEGER, `songCount` INTEGER, `duration` INTEGER, `bitRate` INTEGER, `path` TEXT, `isVideo` INTEGER NOT NULL, `starred` INTEGER NOT NULL, `discNumber` INTEGER, `type` TEXT, `created` INTEGER, `closeness` INTEGER NOT NULL, `bookmarkPosition` INTEGER NOT NULL, `userRating` INTEGER, `averageRating` REAL, `name` TEXT, PRIMARY KEY(`id`, `serverId`))") database.execSQL("CREATE TABLE IF NOT EXISTS `tracks` (`id` TEXT NOT NULL, `serverId` INTEGER NOT NULL DEFAULT -1, `parent` TEXT, `isDirectory` INTEGER NOT NULL, `title` TEXT, `album` TEXT, `albumId` TEXT, `artist` TEXT, `artistId` TEXT, `track` INTEGER, `year` INTEGER, `genre` TEXT, `contentType` TEXT, `suffix` TEXT, `transcodedContentType` TEXT, `transcodedSuffix` TEXT, `coverArt` TEXT, `size` INTEGER, `songCount` INTEGER, `duration` INTEGER, `bitRate` INTEGER, `path` TEXT, `isVideo` INTEGER NOT NULL, `starred` INTEGER NOT NULL, `discNumber` INTEGER, `type` TEXT, `created` INTEGER, `closeness` INTEGER NOT NULL, `bookmarkPosition` INTEGER NOT NULL, `userRating` INTEGER, `averageRating` REAL, `name` TEXT, PRIMARY KEY(`id`, `serverId`))")
} }
} }
/* ktlint-enable max-line-length */

View File

@ -21,11 +21,13 @@ internal val playlistDateFormat by lazy(NONE) { SimpleDateFormat.getInstance() }
fun APIPlaylist.toMusicDirectoryDomainEntity(serverId: Int): MusicDirectory = fun APIPlaylist.toMusicDirectoryDomainEntity(serverId: Int): MusicDirectory =
MusicDirectory().apply { MusicDirectory().apply {
name = this@toMusicDirectoryDomainEntity.name name = this@toMusicDirectoryDomainEntity.name
addAll(this@toMusicDirectoryDomainEntity.entriesList.map { addAll(
this@toMusicDirectoryDomainEntity.entriesList.map {
val item = it.toTrackEntity(serverId) val item = it.toTrackEntity(serverId)
item.serverId = serverId item.serverId = serverId
item item
}) }
)
} }
fun APIPlaylist.toDomainEntity(): Playlist = Playlist( fun APIPlaylist.toDomainEntity(): Playlist = Playlist(

View File

@ -7,7 +7,6 @@ import org.amshove.kluent.`should be equal to`
import org.junit.Test import org.junit.Test
import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild import org.moire.ultrasonic.api.subsonic.models.MusicDirectoryChild
import org.moire.ultrasonic.api.subsonic.models.Playlist import org.moire.ultrasonic.api.subsonic.models.Playlist
import org.moire.ultrasonic.data.ActiveServerProvider
/** /**
* Unit test for extension functions that converts api playlist entity to domain. * Unit test for extension functions that converts api playlist entity to domain.
@ -23,7 +22,7 @@ class APIPlaylistConverterTest : BaseTest() {
) )
) )
val convertedEntity = entity.toMusicDirectoryDomainEntity(ActiveServerProvider.getActiveServerId()) val convertedEntity = entity.toMusicDirectoryDomainEntity(serverId)
with(convertedEntity) { with(convertedEntity) {
name `should be equal to` entity.name name `should be equal to` entity.name