Code Monkey home page Code Monkey logo

Comments (9)

davidbrenner avatar davidbrenner commented on August 17, 2024

Any interest in having this as a feature? Should I try to clean it up or just continue using it for myself?

from supysonic.

spl0k avatar spl0k commented on August 17, 2024

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.

andrenam avatar andrenam commented on August 17, 2024

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.

anarcat avatar anarcat commented on August 17, 2024

@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.

spl0k avatar spl0k commented on August 17, 2024

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.

anarcat avatar anarcat commented on August 17, 2024

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.

andrenam avatar andrenam commented on August 17, 2024

@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.

anarcat avatar anarcat commented on August 17, 2024

from supysonic.

anarcat avatar anarcat commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.