Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show currently playing music on screensaver #2512

Merged
merged 2 commits into from
Feb 20, 2023

Conversation

nielsvanvelzen
Copy link
Member

Changes

  • Separate the LibraryDreamService into separate files for each composable
  • Improve animations
  • Improve LibraryShowcase by loading the image before showing (fixes flickering)
  • Add "now playing" to the screensaver
    • Shows the currently playing track with track/album cover and artist(s)
    • Uses the (darkened) blurhash as background
    • See screenshot below

Screenshots
image

Issues

@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Feb 19, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Feb 19, 2023
import org.koin.androidx.compose.get

@Composable
fun DreamContentNowPlaying(

Check warning

Code scanning / detekt

One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand.

The function DreamContentNowPlaying is too long (73). The maximum length is 60.
val imageBlurHash = imageTag?.let { tag -> item.imageBlurHashes?.get(ImageType.PRIMARY)?.get(tag) }

val imageBlurHashBitmap = remember {
if (imageBlurHash != null) BlurHash.decode(imageBlurHash, 32, 32)?.asImageBitmap()

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
val imageBlurHash = imageTag?.let { tag -> item.imageBlurHashes?.get(ImageType.PRIMARY)?.get(tag) }

val imageBlurHashBitmap = remember {
if (imageBlurHash != null) BlurHash.decode(imageBlurHash, 32, 32)?.asImageBitmap()

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
alignment = Alignment.Center,
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxSize(),
colorFilter = ColorFilter.tint(Color(0f, 0f, 0f, 0.4f), BlendMode.SrcAtop)

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
return@run albumArtist
}.orEmpty(),
style = TextStyle(
color = Color(0.8f, 0.8f, 0.8f),

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
return@run albumArtist
}.orEmpty(),
style = TextStyle(
color = Color(0.8f, 0.8f, 0.8f),

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
return@run albumArtist
}.orEmpty(),
style = TextStyle(
color = Color(0.8f, 0.8f, 0.8f),

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
@nielsvanvelzen nielsvanvelzen merged commit 1aa37fd into jellyfin:master Feb 20, 2023
@nielsvanvelzen nielsvanvelzen added the release-highlight Pull request might be suitable for mentioning in the release blog post label Feb 25, 2023
@nielsvanvelzen nielsvanvelzen deleted the dreaming branch February 27, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release-highlight Pull request might be suitable for mentioning in the release blog post
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant