Skip to content

Commit

Permalink
refactor: copy dummy items to core module
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnedemeulemeester committed Dec 21, 2024
1 parent 6ed7b5e commit df206ce
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.CollectionType
import dev.jdtech.jellyfin.models.FindroidCollection
import dev.jdtech.jellyfin.models.FindroidImages
import java.util.UUID

private val dummyMoviesCollection = FindroidCollection(
id = UUID.randomUUID(),
name = "Movies",
type = CollectionType.Movies,
images = FindroidImages(),
)

private val dummyShowsCollection = FindroidCollection(
id = UUID.randomUUID(),
name = "Shows",
type = CollectionType.TvShows,
images = FindroidImages(),
)

val dummyCollections = listOf(
dummyMoviesCollection,
dummyShowsCollection,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.EpisodeItem
import dev.jdtech.jellyfin.models.FindroidEpisode
import dev.jdtech.jellyfin.models.FindroidImages
import dev.jdtech.jellyfin.models.FindroidMediaStream
import dev.jdtech.jellyfin.models.FindroidSource
import dev.jdtech.jellyfin.models.FindroidSourceType
import org.jellyfin.sdk.model.api.MediaStreamType
import java.time.LocalDateTime
import java.util.UUID

val dummyEpisode = FindroidEpisode(
id = UUID.randomUUID(),
name = "Mother and Children",
originalTitle = null,
overview = "Stories are lies meant to entertain, and idols lie to fans eager to believe. This is Ai’s story. It is a lie, but it is also true.",
indexNumber = 1,
indexNumberEnd = null,
parentIndexNumber = 1,
sources = listOf(
FindroidSource(
id = "",
name = "",
type = FindroidSourceType.REMOTE,
path = "",
size = 0L,
mediaStreams = listOf(
FindroidMediaStream(
title = "",
displayTitle = "",
language = "en",
type = MediaStreamType.VIDEO,
codec = "hevc",
isExternal = false,
path = "",
channelLayout = null,
videoRangeType = null,
height = 1080,
width = 1920,
videoDoViTitle = null,
),
),
),
),
played = true,
favorite = true,
canPlay = true,
canDownload = true,
runtimeTicks = 20L,
playbackPositionTicks = 0L,
premiereDate = LocalDateTime.parse("2019-02-14T00:00:00"),
seriesName = "Oshi no Ko",
seriesId = UUID.randomUUID(),
seasonId = UUID.randomUUID(),
communityRating = 9.2f,
images = FindroidImages(),
chapters = null,
trickplayInfo = null,
)

val dummyEpisodes = listOf(
dummyEpisode,
)

val dummyEpisodeItems = listOf(
EpisodeItem.Episode(dummyEpisode),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.CollectionType
import dev.jdtech.jellyfin.models.HomeItem
import dev.jdtech.jellyfin.models.HomeSection
import dev.jdtech.jellyfin.models.UiText
import dev.jdtech.jellyfin.models.View
import java.util.UUID

val dummyHomeSection = HomeItem.Section(
HomeSection(
id = UUID.randomUUID(),
name = UiText.DynamicString("Continue watching"),
items = dummyMovies + dummyEpisodes,
),
)

val dummyHomeView = HomeItem.ViewItem(
View(
id = UUID.randomUUID(),
name = "Movies",
items = dummyMovies,
type = CollectionType.Movies,
),
)

val dummyHomeItems = listOf(dummyHomeSection, dummyHomeView)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.FindroidImages
import dev.jdtech.jellyfin.models.FindroidMediaStream
import dev.jdtech.jellyfin.models.FindroidMovie
import dev.jdtech.jellyfin.models.FindroidSource
import dev.jdtech.jellyfin.models.FindroidSourceType
import org.jellyfin.sdk.model.api.MediaStreamType
import java.time.LocalDateTime
import java.util.UUID

val dummyMovie = FindroidMovie(
id = UUID.randomUUID(),
name = "Alita: Battle Angel",
originalTitle = null,
overview = "When Alita awakens with no memory of who she is in a future world she does not recognize, she is taken in by Ido, a compassionate doctor who realizes that somewhere in this abandoned cyborg shell is the heart and soul of a young woman with an extraordinary past.",
sources = listOf(
FindroidSource(
id = "",
name = "",
type = FindroidSourceType.REMOTE,
path = "",
size = 0L,
mediaStreams = listOf(
FindroidMediaStream(
title = "",
displayTitle = "",
language = "en",
type = MediaStreamType.VIDEO,
codec = "hevc",
isExternal = false,
path = "",
channelLayout = null,
videoRangeType = null,
height = 1080,
width = 1920,
videoDoViTitle = null,
),
),
),
),
played = false,
favorite = true,
canPlay = true,
canDownload = true,
runtimeTicks = 20L,
playbackPositionTicks = 15L,
premiereDate = LocalDateTime.parse("2019-02-14T00:00:00"),
people = emptyList(),
genres = listOf("Action", "Sience Fiction", "Adventure"),
communityRating = 7.2f,
officialRating = "PG-13",
status = "Ended",
productionYear = 2019,
endDate = null,
trailer = "https://www.youtube.com/watch?v=puKWa8hrvA8",
images = FindroidImages(),
chapters = null,
trickplayInfo = null,
)

val dummyMovies = listOf(
dummyMovie,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.DiscoveredServer
import dev.jdtech.jellyfin.models.Server
import java.util.UUID

val dummyDiscoveredServer = DiscoveredServer(
id = "",
name = "Demo server",
address = "https://demo.jellyfin.org/stable",
)

val dummyDiscoveredServers = listOf(dummyDiscoveredServer)

val dummyServer = Server(
id = "",
name = "Demo server",
currentServerAddressId = UUID.randomUUID(),
currentUserId = UUID.randomUUID(),
)

val dummyServers = listOf(dummyServer)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.FindroidImages
import dev.jdtech.jellyfin.models.FindroidShow
import java.time.LocalDateTime
import java.util.UUID

val dummyShow = FindroidShow(
id = UUID.randomUUID(),
name = "Attack on Titan",
originalTitle = null,
overview = "After his hometown is destroyed and his mother is killed, young Eren Yeager vows to cleanse the earth of the giant humanoid Titans that have brought humanity to the brink of extinction.",
sources = emptyList(),
played = false,
favorite = false,
canPlay = true,
canDownload = false,
runtimeTicks = 0L,
communityRating = 8.8f,
endDate = LocalDateTime.parse("2023-11-04T00:00:00"),
genres = listOf("Action", "Sience Fiction", "Adventure"),
images = FindroidImages(),
officialRating = "TV-MA",
people = emptyList(),
productionYear = 2013,
seasons = emptyList(),
status = "Ended",
trailer = null,
unplayedItemCount = 20,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dev.jdtech.jellyfin.core.presentation.dummy

import dev.jdtech.jellyfin.models.User
import java.util.UUID

val dummyUser = User(
id = UUID.randomUUID(),
name = "Username",
serverId = "",
)

val dummyUsers = listOf(dummyUser)

0 comments on commit df206ce

Please sign in to comment.