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] Possible internals improvement #2

Open
LisandraBrave opened this issue Jan 27, 2020 · 0 comments
Open

[Feature request] Possible internals improvement #2

LisandraBrave opened this issue Jan 27, 2020 · 0 comments

Comments

@LisandraBrave
Copy link

Instead of writing out play counts to the PCNT frame, write playcounts to an external database. Benefits include not modifying the files themselves, just a simple database file (could even be as simple as filepath playcount, although that could run into the known issues with unix filenames being too permissive), not relying on media files having a specific kind of metadata storage (FLAC is probably the most notable example), and being able to track playcounts on read only files.

Rough skeleton would be something like

On play, search database for track filepath, if not found add it
If song is skipped before search is finished, ignore searching or adding
if found/added, add playcount to playlist meta (if it doesn't exist)
on event 1000, read in ddb_event_trackchange_t *from for previous song, get filepath, and, if playtime from ddb_event_trackchange_t is over some amount of time (could be configurable!), increment playcount in database and in playlist, then reload previous song metadata

I'd write a PR for it myself if I knew a lick of C, but I don't.

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

1 participant