Skip to content

Commit

Permalink
MediaColDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Dec 5, 2023
1 parent f7fbc75 commit 5e910d8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/kotlin/de/gmuth/ipp/attributes/MediaColDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import java.util.logging.Level
import java.util.logging.Logger

class MediaColDatabase(val mediaCollections: List<MediaCollection>) {

companion object {
fun fromAttributes(attributes: IppAttributesGroup) = MediaColDatabase(
attributes
.getValues<List<IppCollection>>("media-col-database")
.map { MediaCollection.fromIppCollection(it) }
)
fun fromAttributes(attributes: IppAttributesGroup) =
fromIppCollections(attributes.getValues("media-col-database"))

fun fromIppCollections(mediaIppCollections: List<IppCollection>) =
MediaColDatabase(mediaIppCollections.map { MediaCollection.fromIppCollection(it) })
}

fun findMediaWithNameContaining(text: String) =
Expand Down

0 comments on commit 5e910d8

Please sign in to comment.