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

Option to sync playlists with playlist files/folder #832

Closed
manuke42 opened this issue Feb 23, 2021 · 9 comments
Closed

Option to sync playlists with playlist files/folder #832

manuke42 opened this issue Feb 23, 2021 · 9 comments

Comments

@manuke42
Copy link

Hello, would it be possible to add some option to sync the changes of a playlist made in the Music app with a m3u file in the Files app?

I have many playlists and would have to export every one of them to a file to backup. Additionally i like to sync my music to my computer and get the latest playlist there too to work with local m3u players (i already like that the m3u files use relative paths, when they are exported from Music app). Maybe to make it more complete there could be an optional folder created in the Files app where the playlists are automatically synced?

@paulijar
Copy link
Collaborator

paulijar commented Mar 2, 2021

Maybe this kind of "advanced" option would be more suitable to be available on the command line with the occ tool 🤔. A cron job could then be set up to run it periodically. Not terribly handy, but on the other hand, this might not be so commonly used feature that it would justify sinking all the work needed to design and implement a new UI feature.

@haeringer
Copy link

@paulijar Is it foreseeable that you want to address this in the near future? As for myself, I don't really know much about PHP. I would also be willing to create a bounty, but I'm unsure if bountysource.com is still trustable...

@paulijar
Copy link
Collaborator

Yes, I'm considering making this occ command at some point. Probably sooner, if there is a bounty ;). Bountysource worked well a year ago, but I have no other experience on it. But I guess that there ought to be some competing services, too.

paulijar added a commit to paulijar/music that referenced this issue Oct 28, 2021
The command may be used to export one, several, or all playlists of a
user or multiple users to a file. By default, the playlists are exported
to the user home directory but another directory may be given with an
optional argument.

refs owncloud#832
paulijar added a commit that referenced this issue Oct 30, 2021
The command may be used to import one or several playlists from file(s)
for one or multiple users. If the user already has a playlist with the same
name as the file, then either option `overwrite` or `append` has to be used.

refs #832
paulijar added a commit that referenced this issue Oct 30, 2021
The command may be used to import one or several playlists from file(s)
for one or multiple users. If the user already has a playlist with the same
name as the file, then either option `overwrite` or `append` has to be used.

refs #832
@paulijar
Copy link
Collaborator

Music v1.4.1 is now out, bringing the occ commands playlist-export and playlist-import. The OP's requirement should be fulfilled by running the former with the arguments --all-lists and --overwrite. To do this periodically, a cron job should be set up.

@M1scer
Copy link

M1scer commented Nov 1, 2021

I am just trying to get the playlist-import running. I want to import all playlists (.m3u) in a specific folder.
But i can not get the occ command running.

The command i tried (to import at least one playlist):
sudo -u www-data php occ music:playlist-import --group admin --file "/Path/to/Playlist.m3u"
I always get "Invalid file path" error but i am sure the path is correct.

And how do i import all lists in a folder?

A few examples of running the command would be helpful for me.

@paulijar
Copy link
Collaborator

paulijar commented Nov 1, 2021

@M1scer Sorry, importing all lists in a folder is not implemented for now. But you can import several lists with a single command by listing them one-by-one, by giving multiple --file arguments.

The path to the file should be given relative to the home folder of the user within the cloud file system. It doesn't matter if you prefix the path with / or not, the path is always resolved in relative manner.

@M1scer
Copy link

M1scer commented Nov 1, 2021

@paulijar is this planned to be added?

Thank you, now it is working fine. i tried it with a absolute path before.

@paulijar
Copy link
Collaborator

paulijar commented Nov 1, 2021

is this planned to be added?

Possibly. Ideally, I'd like to have it so that the --file argument would support wildcard characters, enabling importing e.g. some/path/*.m3u.

paulijar added a commit that referenced this issue Nov 25, 2021
Wildcard characters * and ? are now supported when defining the name(s)
of playlists files to import. These characters are *not* interpreted as
wildcards when they are part of the directory name (on Linux, these
characters are allowed as ordinary characters in any file/folder name).

refs #832
@paulijar
Copy link
Collaborator

@M1scer The newly released Music v1.5.0 now allows using wildcard characters * and ? in the --file argument of occ music:playlist-import. With this, it is possible to import e.g. all the playlist files from a certain folder.

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

No branches or pull requests

5 participants
@haeringer @manuke42 @paulijar @M1scer and others