Bug 449262 - Support relative paths in playlist files
Summary: Support relative paths in playlist files
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-27 19:17 UTC by telefza
Modified: 2022-08-26 10:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.12
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description telefza 2022-01-27 19:17:57 UTC
SUMMARY
***
I have the same set of music on different computers synced via Nextcloud. For a playlist created on one computer to work on another it needs to contain the exact same paths.
However the nextcloud folders are in different locations on the different machines.
It would be cool if I could just use `$NEXTCLOUD` as an environmental variable in the playlists and elisa would know to replace `$NEXTCLOUD` with the actual path.
***
Comment 1 Nagy Tibor 2022-01-27 20:21:55 UTC
The M3U playlist format already provides a solution for this by allowing relative paths in the playlist files. Elisa could implement that for example by adding a "Use relative paths" checkbox to the playlist saving dialog instead of coming up a custom more convoluted solution.
Comment 2 telefza 2022-01-27 20:32:15 UTC
(In reply to Nagy Tibor from comment #1)
> The M3U playlist format already provides a solution for this by allowing
> relative paths in the playlist files. Elisa could implement that for example
> by adding a "Use relative paths" checkbox to the playlist saving dialog
> instead of coming up a custom more convoluted solution.

Thanks for pointing this out. I tried it out and it works just fine.  still a bit annoying having to make the playlist with relative paths.
> "Use relative paths" checkbox
this I think would make me very happy.
Comment 3 Nate Graham 2022-01-27 21:28:05 UTC
Relative path support sounds ideal.
Comment 4 telefza 2022-01-30 11:21:50 UTC
In the meantime  if anybody else has this problem. I wrote a little script that makes a relative path playlist from what elisa outputs, see (https://gitlab.com/-/snippets/2244359)
Comment 5 Bug Janitor Service 2022-07-16 03:28:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/375
Comment 6 Nate Graham 2022-08-26 10:10:02 UTC
Git commit 220c110b2f8e78de9b86aa9178a54a5d2466ad47 by Nate Graham, on behalf of Yerrey Dev.
Committed on 26/08/2022 at 10:09.
Pushed by ngraham into branch 'master'.

Support saving playlist with relative paths

Adds the support for saving playlists with relative paths in cases where
the music files are located in the same folder as the playlist to be saved.
This setting is "Prefer relative paths" by default as that seems to be
common with most music players.

A new persistent config `alwaysUseAbsolutePlaylistPaths` is created, which
is then checked in `MediaPlayListProxyModel::savePlaylist`. With a false
value, music files in the same folder as the playlist are pathed with just
the filename, otherwise with absolute paths. With a true value an absolute
path is always used.
FIXED-IN: 22.12

M  +7    -0    src/elisa_core.kcfg
M  +16   -0    src/localFileConfiguration/elisaconfigurationdialog.cpp
M  +16   -0    src/localFileConfiguration/elisaconfigurationdialog.h
M  +22   -4    src/mediaplaylistproxymodel.cpp
M  +27   -0    src/qml/SettingsForm.qml

https://invent.kde.org/multimedia/elisa/commit/220c110b2f8e78de9b86aa9178a54a5d2466ad47