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

Add artist top songs #552

Merged
merged 21 commits into from
Dec 14, 2023
Merged

Conversation

Tiefseetauchner
Copy link
Contributor

@Tiefseetauchner Tiefseetauchner commented Dec 9, 2023

From issue #551

Please don't be shy to roast the code, first time ever working in flutter, I can't imagine it being any good. I don't know what the usual way to do the application id is, I left it in because I'll probably debug but I suspect we'll remove it just before merging (if this is merged)

There's a TODO I can't resolve, as I don't really understand the technical use of all the variables of SongsSliverList

I realised while pondering over the changes that this affects the genre selection too, I think that's actually a pretty neat feature

One thing that's still left is to actually add the queue, I do not know how to do that. We have the sorted - wait is that what the queue variable is for - oh nevermind, i'll figure that out later, I'll leave this as a draft for now

@Tiefseetauchner
Copy link
Contributor Author

Now queues work, and there's no duplicate code, there's a little bit of unprettyness in the SongListTile class as I used the isInPlaylist for artist views now too (to display the correct name somewhere I don't remember, I think in the queue), that should probably be changed

@Tiefseetauchner Tiefseetauchner marked this pull request as ready for review December 9, 2023 12:40
@@ -44,7 +44,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.unicornsonlsd.finamp"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to change that

@Tiefseetauchner
Copy link
Contributor Author

Tiefseetauchner commented Dec 9, 2023

Example image
Example Screenshot showing a top list of songs and albums underneath

@Chaphasilor
Copy link
Collaborator

Regarding the app ID, I think the way @jmshrv and myself always do it is to just overwrite the currently installed version with the debug version 😅 I also use my old phone for initial testing.
Might be worth looking into how to make this more seamless...

@jmshrv
Copy link
Owner

jmshrv commented Dec 10, 2023

I'm pretty much always on a dev build lol, I really need a button to redownload everything I last had because I keep corrupting the databases

@Chaphasilor Chaphasilor linked an issue Dec 11, 2023 that may be closed by this pull request
@Chaphasilor
Copy link
Collaborator

I'm currently testing another PR on my phone, so I'll take a look at the actual running app later. For now I just looked through the code. But this seems nice so far! :)

- fix null issues
- have jellyfin sort songs
@Tiefseetauchner
Copy link
Contributor Author

Thanks for the auto builds btw, now I can work without being able to build it xD

Copy link
Collaborator

@Chaphasilor Chaphasilor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think that should be the last review. test it in the coming days and merge it asap :D

style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
)),
SongsSliverList(
childrenForList: songs.take(5).toList(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for missing this at first, but we should probably use the limit parameter for the getItems() call instead. Right now there's no need to get all songs by an artist, and the performance difference could be significant if an artist has hundreds of songs.
Especially since we're waiting for both future to complete before building the widget

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is kind of, it's used for the queue. We might be able to do it asynchronously though after the widget is loaded, or just accept that only five songs are in the queue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Yeah the initial page with 5 tracks + fetching the other songs after playback starts would be a good approach I think. I'm also planning to implement this for the regular songs tab to enable in-order playback starting at a specific song

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I don't think I can do that with my current knowledge of dart, I suspect we'd pass a delegate through but I cannot figure out how to await the result in a future in a synchronous method to pass it in as a delegate. I'll set it to limit to 5 for now and see whether I can figure it out, any help would be greatly appreciated as that's a primary usecase for me currently

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to support this in the QueueService somehow, where you can specify some initial tracks as well as the initial index, and then to callbacks/futures(?) that fetch songs to be prepended (first track to first of initial tracks, if any) and songs to be appended (last of initial tracks to last tracks, if any) to the queue. I imagining that should work, but I haven't tested it yet

@Chaphasilor
Copy link
Collaborator

Okay, this looks good to me! We can merge from my side, if that's fine with you? :)

@Tiefseetauchner
Copy link
Contributor Author

Yep

@Chaphasilor Chaphasilor merged commit 6af1d72 into jmshrv:redesign Dec 14, 2023
@Chaphasilor
Copy link
Collaborator

Merged, thanks a ton! 😁
Onto the next one...

@Chaphasilor
Copy link
Collaborator

@Tiefseetauchner re: application ID, I actually "looked into it" and there is a way in the gradle config to set a suffix for debug builds, so I'll change that up in the redesign branch soon: https://www.perplexity.ai/search/how-can-I-_XOgxvRgQT.gEmngt1jOXw?s=u :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Artist "Most played" list
3 participants