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

Play count keeps resetting #3

Open
onebrownfinch opened this issue Nov 28, 2022 · 3 comments
Open

Play count keeps resetting #3

onebrownfinch opened this issue Nov 28, 2022 · 3 comments

Comments

@onebrownfinch
Copy link

Hello -- thank you so much for writing this script, it's super easy to use! I'm not sure if you'd be able to help, but basically I've run into a problem where the play count is reset to its former value after some time (usually only a minute or two). I suspect it has something to do with the iCloud Music Library, as I'm an Apple Music subscriber, so idk if you can help here. It doesn't matter whether the manually input play count is higher or lower than the preexisting one, nor does it matter whether the track is uploaded or matched / downloaded from AM. I've tried using your script and then playing and skipping to the end of the track, but this results in the same problem plus one extra play. Also, initiating a sync of my cloud library just makes the problem pop up even more quickly, and I've tried quitting out of AM on my phone prior to changing the play count, as well as using Apple's "reset play count to 0" feature (which, itself, works) prior to running the script, both to no avail.

Any insight? Thanks in advance!

@davidjb
Copy link
Owner

davidjb commented Nov 28, 2022

You're very welcome - thanks for the compliment.

It sounds like your issue is the same or similar to one that was described previously - #1 (comment). I don't use a cloud music library so haven't experienced this myself or know of a workaround, sorry. If you come across a solution, then it could potentially be factored into the AppleScript. PRs are most definitely welcome 👍

@onebrownfinch
Copy link
Author

Yeah, I did some digging after adding this comment and realized that it indeed is an AM / cloud library issue. I'm an AppleScript newbie so I'll likely be tinkering with it for some time before I come up with any useful solution, but I have a good idea on how to maybe subvert the issue. Thanks for your prompt reply!

@onebrownfinch
Copy link
Author

onebrownfinch commented Nov 30, 2022

If you're at all interested, I spent some time writing a bit of code that seems to work okay...it's built around the idea that skipping to the tail end of a track and playing it will actually update the play count. As I said, I'm no AppleScript professional, just someone who codes like 4 times a year for fun, so I'm sure it's a bit janky and there's a better way to do parts of it. If you get the chance to look at it / have some thoughts on how to make it better, I'm all ears!

Some bugs that I've noticed pop up sometimes:

  • Code adds one too few or one too many plays
  • Code stops after a few runs for no discernible reason
  • Code never runs in the first place -- this one I'm pretty sure is a Music issue, rather than an AppleScript one. Music doesn't like repeatedly playing and fast-forwarding tracks. Restarting Music usually fixes this.

Edit: I updated the code to work with your "apply to all" feature.
Edit: Okay, I think I've gotten the code to work without bugging out on me. I've run it multiple times without incurring any of the issues I mentioned, but unfortunately it still is a bit of a slow-mover, at least on my computer.

Play Count Sandbox 3.0.zip

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

No branches or pull requests

2 participants