rasmuslos / AmpFin

Native Jellyfin music player for iOS & iPadOS
Other
107 stars 10 forks source link

Playlist bug #16

Closed PauFCB closed 4 months ago

PauFCB commented 5 months ago

The playlist show the name, total tracks and duration but not the cover and can't be played or shuffled IMG_2662

rasmuslos commented 5 months ago

The cover is actually working as intended, but judging by the size of the playlist I think one of the tracks is not converted correctly. Does the "Tracks" library section work for you?

PauFCB commented 5 months ago

The cover is actually working as intended, but judging by the size of the playlist I think one of the tracks is not converted correctly. Does the "Tracks" library section work for you?

yes, the tracks section work

rasmuslos commented 5 months ago

In the online & offline tab?

PauFCB commented 5 months ago

In the online & offline tab?

I don't know if when offline too because I can't download anything, the spinner that indicates the download process never stops

rasmuslos commented 5 months ago

Are there any other item types (so for example movies, episodes, etc.) in the playlist? I think the APIClient cannot parse the response it is getting from the server. And if you are able to view all of you tracks in the library tab this is the most likely cause

PauFCB commented 5 months ago

No, only flac mp3 and m4a files that working on the web version and other clients (finamp, fintunes)

PauFCB commented 5 months ago

Some more screenshots if that help. First one is when try to add a song to a playlist. IMG_2709 Edit: if I create a new playlist with the web browser, then it shows in the app but not the big cover (when I open it, only the small in the list view). Also, existing playlist still don't work (don't know if is for the size) and can't download items, the spinner never stops

rasmuslos commented 5 months ago

This is really wired, it seems like there is something wrong with your playlists, not the tracks themselves. Have you tried the latest build, I have made some updates to the playlist parsing logic.

Also, can you run the app using Xcode to provide a more detailed error message?

PauFCB commented 5 months ago

I try with different playlist (all flac 16/44), working with the web version and other clients but still not working with the latest release, and a new bug appears, playlist duration. IMG_2715 Apart from that, the app working fast and good (only the artist bios: sometimes it shows and sometimes don't).

rasmuslos commented 5 months ago

Can you share a screenshot of the playlist? And thanks for the kind words, I guess the artists don't have a bio set in Jellyfin, otherwise please open a separate issue.

PauFCB commented 5 months ago

It's attached above, thanks

rasmuslos commented 4 months ago

Can you try this build: AmpFin.ipa.zip

PauFCB commented 4 months ago

Now I can play and shuffle the playlist normally but the total duration isn't correct yet.

rasmuslos commented 4 months ago

Do all tracks show up? The duration might not be correct because the new versions removes tracks that cannot be parsed. So you might have some tracks in your playlist that do not belong to an album, which are now removed and not counted to the total duration.

PauFCB commented 4 months ago

Do all tracks show up? The duration might not be correct because the new versions removes tracks that cannot be parsed. So you might have some tracks in your playlist that do not belong to an album, which are now removed and not counted to the total duration.

Maybe the thing that I have some singles that not belongs to any album be the reason

rasmuslos commented 4 months ago

Do all tracks show up? The duration might not be correct because the new versions removes tracks that cannot be parsed. So you might have some tracks in your playlist that do not belong to an album, which are now removed and not counted to the total duration.

Maybe the thing that I have some singles that not belongs to any album be the reason

This could be the reason, but it is more likely that some albums are not parsed correctly.

But do the other tracks show up? And is the duration still to long or to short?

PauFCB commented 4 months ago

Yes it show all the tracks and can play and shuffle only the total playlist duration is wrong, but it's correct for each song individually

rasmuslos commented 4 months ago

Yes it show all the tracks and can play and shuffle only the total playlist duration is wrong, but it's correct for each song individually

Great! Is it to short or t long?

PauFCB commented 4 months ago

Its too long, like millions of hours for a 100 songs playlist,

rasmuslos commented 4 months ago

Did you download the playlist? Because the duration is parsed directly from the Jellyfin server https://github.com/rasmuslos/AmpFin/blob/main/AmpFinKit/Sources/AFBase/Extensions/Item/Playlist+Convert.swift

PauFCB commented 4 months ago

No, only stream, I don't download anything yet

rasmuslos commented 4 months ago

Is the time reported correctly in the web interface?

PauFCB commented 4 months ago

yes, 6h 49min vs 11.554.680h total duration. It's not an importan bug, because when a song start playing the time it's correct for each song, but the total duration stay the same.

rasmuslos commented 4 months ago

The main issue has been resolved, so I will close this. I will keep an eye out for this bug, but for now I don't know where it could come from...

gfoldv commented 4 months ago

@rasmuslos in the above mentioned code the division by 10_000_000 is not applied since the item.RunTimeTicks has value. You need to apply the ?? operator first, like duration: Double((item.RunTimeTicks ?? 0) / 10_000_000)

rasmuslos commented 4 months ago

@rasmuslos in the above mentioned code the division by 10_000_000 is not applied since the item.RunTimeTicks has value. You need to apply the ?? operator first, like duration: Double((item.RunTimeTicks ?? 0) / 10_000_000)

I am really stupid, thanks a lot! Normally I notice this mistake but apparently not this time...