Comments (9)
Any interest in having this as a feature? Should I try to clean it up or just continue using it for myself?
from supysonic.
It'll be difficult to get something that works.
The M3U format allows both absolute and relative paths. Relative paths require that the playlist file to be created in a well known location, such as one of the root music folders. Playlists with absolute paths would only work if they are created on the computer running the server or if the the server have the same directory structure as the computer we're uploading the playlist from.
Those are strong conditions which are unlikely to be met in the general case.
from supysonic.
Indeed, the general scenario does not always work like that.
Personally, I use supysonic and mpd both on the same server. I synchronize supysonic's playlist and mpd's playlist via a custom cronjob, but I realize that's not meant to be merged into the upstream version. :-)
from supysonic.
@andrenam how do you import playlists from a cronjob? i'd love to do that myself...
i looked at the database layout and couldn't make head or tails of it. for example, I just created a playlist from an album and supysonic created this in the MySQL database:
MariaDB [supysonic]> select id,tracks from playlist\G
*************************** 1. row ***************************
id: ��PN�i@��Ƕ
�7
tracks: 7ccb5785-69e0-44e7-81d9-834c11d35028,561cc6be-0550-4a1e-be70-10591362819f,811c749a-9a7b-4a57-a69a-8f54e615337c,54a340d0-3d2b-46dd-832e-15e0555142ca,c1ad9e8e-c208-418c-a371-932f66ed81e7,0b9ccf41-ca25-486c-8de6-d657e0f6994b,11427740-2cff-4e20-a59a-babc9effd6f9,aa4db976-80c1-4129-bb08-fdd5beebddd9,fec80de3-5f6c-4213-b82c-256d4744023c,16cdf38d-2a48-41cc-bb9d-3383de4efa14,e18844bb-e7b8-4b33-956a-7293a6e61b0d,119386aa-fa5f-4da3-b661-50866d5e2dab
The first thing that surprised me are the BINARY
fields like id
here. But then I'm puzzled by the tracks
column as well: those look like UUIDs but I can't find the same entries in the track
table...
I was hoping I could just sync on-disk m3u playlists I generate from mpd into supysonic as well, so I would really like to see how @andrenam does their cronjob things. :)
from supysonic.
Primary keys are all UUIDs. Pony tends to store them as their binary representation, you'll have more luck making sense of them on PostgreSQL since it natively support this type. The tracks
column here are the "human readable" UUIDs referencing entries on the track
table. They're handled on the Python side. This is a comma-separated list string because I was too lazy at the time to define a proper many-to-many relation.
I don't know about @andrenam setup, but at that time Supysonic used storm rather than PonyORM, and storm stored UUIDs in a nicer representation than Pony does.
from supysonic.
oh wow, weird. binary UUIDs. :) i did not know this was a PostgreSQL thing... it might be worth outlining pgsql as the primary supported database if weird stuff like that happens in MySQL :) But it seems MySQL 8 (?!) has added support for UUIDs according to this post. And there seems to be a BIN_TO_UUID function I can use to do magic stuff with it, so it seems I might be able to get away with this without having to deploy a pgsql cluster.
In any case, I think it would be great to have something like what @davidbrenner proposed. His patch has some site-specific stuff embeded and would need a little cleaning up, but otherwise it seems sound to me.
Another thing to work on for me, I guess. :)
from supysonic.
@anarcat: I can get back to you maybe next weekend, as I'm in the middle of moving houses.
Back in the day, I didnt touch the database directly but used python, imported the relevant supysonic modules and used that to store/add playlists. Maybe it was with storm...
from supysonic.
from supysonic.
hello @andrenam ! how was the move? :) did you have time to look into this again? any code you can share with out would be very helpful... thanks!
from supysonic.
Related Issues (20)
- FR: Reach API level 1.11.0 HOT 6
- supysonic-server command not available HOT 2
- Testsuite failure with Python 3.11 HOT 9
- supysonic-daemon as normal user HOT 2
- supysonic-daemon settings HOT 5
- PostgreSQL error HOT 8
- Ongoing work to extend subsonic API HOT 7
- Error during migration with 7.4 HOT 2
- Intermittent '500 Internal Server Error' (possibly due to postgres query syntax) HOT 3
- Server error when accessing starred albums
- [Enchancement] Gunicorn request size limit HOT 3
- peewee.OperationalError: Server has gone away HOT 3
- Multiple artist albums have only 1 track HOT 4
- ValueError: badly formed hexadecimal UUID string in getAlbum.view HOT 2
- Error message should be logged on login failure
- can't play songs with accented character when using supysonic wsgi HOT 3
- tests/frontend/test_user.py tries to import escape from flask
- More folder management options HOT 2
- flaky test tests.base.test_watcher.AudioWatcherTestCase.test_move_out causes timeouts HOT 3
- Postgresql migration to 0.7.7. fails due to syntax (reserved word)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supysonic.