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

[Feature request] Scrobble songs played when offline #106

Closed
el-tiuri opened this issue Feb 23, 2022 · 12 comments
Closed

[Feature request] Scrobble songs played when offline #106

el-tiuri opened this issue Feb 23, 2022 · 12 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@el-tiuri
Copy link

It’d be great if songs played while offline were synced with the server when going back online. Play:sub does this, to give an example.

@BLeeEZ BLeeEZ added enhancement New feature or request good first issue Good for newcomers labels Feb 23, 2022
@BLeeEZ
Copy link
Owner

BLeeEZ commented Feb 23, 2022

Sounds good. I add it to the feature list.

@BLeeEZ
Copy link
Owner

BLeeEZ commented Mar 12, 2022

The feature is implemented in this commit 8cd927f.

@BLeeEZ
Copy link
Owner

BLeeEZ commented May 25, 2022

I assume this can be closed. If not feel free to reopen it again.

@BLeeEZ BLeeEZ closed this as completed May 25, 2022
@bbsixzz
Copy link

bbsixzz commented Feb 24, 2023

I can't make this work with Amperfy 1.1.2 (3) and Navidrome v0.49.3

I play a cached track with offline mode off while connected to 4G.

After playing the track I connect to my home network using VPN and Amperfy doesn't scrobble the track that was previously played.

Rebooting the app doesn't push the "offline" scrobble either.

If I play a new track while connected to my home network with VPN scrobbling works.

I could connect to VPN at all times and have no problem but I just want clarification how this is supposed to work or if this is a bug.

@BLeeEZ
Copy link
Owner

BLeeEZ commented Feb 25, 2023

When you are in offline mode or no network is reachable the song gets added to the database with upload required flag.
When you switch to online mode or the app gets restarted the flagged songs gets scrobbled from database.
The check for network reachability is always used in the scrobble class. So if the songs gets scrobbled when you are in VPN and online mode, the offline scrobbled songs should work too.

@bbsixzz
Copy link

bbsixzz commented Feb 25, 2023

Ok thank you that's exactly what I thought, what I'm saying is it doesn't work for me.

I think I know what's going on.

I did a test listening to a cached track while disconnected from wifi using only cellular.

After the track finished I connected to my home network with VPN over cellular and the scrobble came through!

However, if I have wifi on and am connected to a different network (not my home network) the same procedure doesn't work.

It seems like there is a specific wifi off flag requirement for this to work.

@el-tiuri
Copy link
Author

I’m also having issues with this. Wouldn’t it make more sense to see if the server is available, rather than looking at network connectivity? After all, scrobbling is dependent on the server itself, which can be unavailable even if your phone is connected to the internet.

@el-tiuri
Copy link
Author

In addition, upon testing some more again, it seems like all the scrobbles are timestamped for the moment the device goes online again, rather than the moment they were played. This seems like a bit of an oversight as well.

@el-tiuri
Copy link
Author

I took a look at the code, hoping I could write a fix myself (at least for the time stamp issue). As far as I understand the date a song is played is cached, but that time stamp just isn’t used when pushing the play to the server (it explicitly uses date: nil). It seems like an easy fix, but it’s been a long while since I’ve coded.

Would you accept a PR to fix this, @BLeeEZ? If so, I think I’ll invest the time in reading up a bit and trying to write a fix.

@BLeeEZ
Copy link
Owner

BLeeEZ commented Jul 20, 2023

I am happy for every incoming PR.

@bbsixzz
Copy link

bbsixzz commented Jul 20, 2023

Hey @BLeeEZ beta has expired, is there a pause over the summer or just no more betas moving forward?

Cheers

@BLeeEZ
Copy link
Owner

BLeeEZ commented Jul 20, 2023

Hi, there is currently nothing to test. I will release a new beta when enough features are ready to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants