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

Handle m3u playlists containing relative paths correctly #45

Open
andreyponomarevru opened this issue Dec 25, 2024 · 0 comments
Open

Handle m3u playlists containing relative paths correctly #45

andreyponomarevru opened this issue Dec 25, 2024 · 0 comments
Assignees
Labels
bug type feature type high priority

Comments

@andreyponomarevru
Copy link
Owner

andreyponomarevru commented Dec 25, 2024

Current behavior: when you create a playlist in VLC and save it, the m3u file contains absolute paths, which are parsed and handled 100% correctly. But if you create and save a playlist in Quod Libet, it always contains relative paths to tracks — and currently such paths are not supported, the script throws the error (see below):

yarn run extracttracklist ../mixes_mine/2024\ -\ 03.12.2024/deep.m3u 
yarn run v1.22.19
$ npx tsx ./src/m3u-to-tracklist '../mixes_mine/2024 - 03.12.2024/deep.m3u'
The following M3U file paths are broken: 

../../tracks/1988 EP/03 Full Moon.flac
../../tracks/Manuel Darquart - The Adriatic EP/03 - Lovin' U.flac
../../inbox-new/2014 - Moonlight Fantasy/02 Illusions.flac
../../tracks/01 - Larry Heard - Guidance (Calm).flac
../../tracks/Seafoam - Easy Tiger EP (2024) [WEB FLAC]/01 Seafoam - Easy Tiger.flac
../../tracks/Dubbyman-Obsession-(ISSUES02)-24BIT-WEB-FLAC-2023-dh/04-dubbyman--obsession_(estrato_aurora_pink_houses_reshape)-dh.flac
../../tracks/02. 30-70 - Tastes Like Freedom (Chaos In The CBD Remix).flac
../../tracks/Gilbert-Astral_Harmonics-(DWT013)-WEB-2024/02-Gilbert-Quantum_Echoes.flac
../../tracks/01-Global_Communication-Incidental_Harmony.flac
../../tracks/6 - Steamfunk.flac
../../inbox-new/Hugo LX - The Platinum Wave/04 - Zio.flac
../../tracks/Glenn Underground - The Jerusalem EPs (Peacefrog Records PF066CD 1997)/03 - Glenn Underground - Keep The Hidden Treasures (Tech-no Jaz Mix).flac
../../inbox-new/DJ Sotofett - Drippin For A Tripp (Tripp-A-Dubb-Mix) 16-48 FLAC/B2 - Nimbus-Mix.flac
npm notice
npm notice New major version of npm available! 10.8.3 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g [email protected]
npm notice
Done in 5.01s.

The m3u playlist saved in Quod Libet and producing the error shown above looks as follows:

#EXTM3U
#EXTINF:304,Byron The Aquarius, MDMA - Full Moon
../../tracks/1988 EP/03 Full Moon.flac
#EXTINF:402,Manuel Darquart - Lovin' U
../../tracks/Manuel Darquart - The Adriatic EP/03 - Lovin' U.flac
#EXTINF:446,Vincent Floyd - Illusions
../../inbox-new/2014 - Moonlight Fantasy/02 Illusions.flac
#EXTINF:746,Larry Heard - Guidance (Calm)
../../tracks/01 - Larry Heard - Guidance (Calm).flac
#EXTINF:433,Seafoam - Easy Tiger
../../tracks/Seafoam - Easy Tiger EP (2024) [WEB FLAC]/01 Seafoam - Easy Tiger.flac
#EXTINF:422,Dubbyman - Obsession (Estrato Aurora Pink Houses Reshape)
../../tracks/Dubbyman-Obsession-(ISSUES02)-24BIT-WEB-FLAC-2023-dh/04-dubbyman--obsession_(estrato_aurora_pink_houses_reshape)-dh.flac
#EXTINF:350,30/70, Allysha Joy - Tastes Like Freedom (Chaos In The CBD Remix)
../../tracks/02. 30-70 - Tastes Like Freedom (Chaos In The CBD Remix).flac
#EXTINF:324,Gilbert - Quantum Echoes
../../tracks/Gilbert-Astral_Harmonics-(DWT013)-WEB-2024/02-Gilbert-Quantum_Echoes.flac
#EXTINF:521,Global Communication - Incidental Harmony
../../tracks/01-Global_Communication-Incidental_Harmony.flac
#EXTINF:364,D'Marc Cantu - Steamfunk
../../tracks/6 - Steamfunk.flac
#EXTINF:300,Hugo LX, Christopher Johnson - Zio
../../inbox-new/Hugo LX - The Platinum Wave/04 - Zio.flac
#EXTINF:406,Glenn Underground - Keep The Hidden Treasures (Tech-no Jaz Mix)
../../tracks/Glenn Underground - The Jerusalem EPs (Peacefrog Records PF066CD 1997)/03 - Glenn Underground - Keep The Hidden Treasures (Tech-no Jaz Mix).flac
#EXTINF:537,DJ Sotofett, Jaakko Eino Kalevi, Phillip Lauer - Nimbus-Mix
../../inbox-new/DJ Sotofett - Drippin For A Tripp (Tripp-A-Dubb-Mix) 16-48 FLAC/B2 - Nimbus-Mix.flac

Current solution is to open an m3u file in VLC and save it again, it will silently convert paths to absolute ones, so the playlist will look as follows:

#EXTM3U
#EXTM3U
#EXTINF:304,Byron The Aquarius MDMA - Full Moon
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/1988%20EP/03%20Full%20Moon.flac
#EXTINF:402,Manuel Darquart - Lovin' U
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/Manuel%20Darquart%20-%20The%20Adriatic%20EP/03%20-%20Lovin'%20U.flac
#EXTINF:446,Vincent Floyd - Illusions
file:///mnt/CE64EB6A64EB53AD/music-lib/inbox-new/2014%20-%20Moonlight%20Fantasy/02%20Illusions.flac
#EXTINF:746,Larry Heard - Guidance (Calm)
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/01%20-%20Larry%20Heard%20-%20Guidance%20(Calm).flac
#EXTINF:422,Dubbyman - Obsession (Estrato Aurora Pink Houses Reshape)
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/Dubbyman-Obsession-(ISSUES02)-24BIT-WEB-FLAC-2023-dh/04-dubbyman--obsession_(estrato_aurora_pink_houses_reshape)-dh.flac
#EXTINF:350,30/70 - Tastes Like Freedom (Chaos In The CBD Remix)
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/02.%2030-70%20-%20Tastes%20Like%20Freedom%20(Chaos%20In%20The%20CBD%20Remix).flac
#EXTINF:324,Gilbert - Quantum Echoes
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/Gilbert-Astral_Harmonics-(DWT013)-WEB-2024/02-Gilbert-Quantum_Echoes.flac
#EXTINF:521,Global Communication - Incidental Harmony
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/01-Global_Communication-Incidental_Harmony.flac
#EXTINF:364,D'Marc Cantu - Steamfunk
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/6%20-%20Steamfunk.flac
#EXTINF:300,Hugo LX Christopher Johnson - Zio
file:///mnt/CE64EB6A64EB53AD/music-lib/inbox-new/Hugo%20LX%20-%20The%20Platinum%20Wave/04%20-%20Zio.flac
#EXTINF:406,Glenn Underground - Keep The Hidden Treasures (Tech-no Jaz Mix)
file:///mnt/CE64EB6A64EB53AD/music-lib/tracks/Glenn%20Underground%20-%20The%20Jerusalem%20EPs%20(Peacefrog%20Records%20PF066CD%201997)/03%20-%20Glenn%20Underground%20-%20Keep%20The%20Hidden%20Treasures%20(Tech-no%20Jaz%20Mix).flac
#EXTINF:537,DJ Sotofett Jaakko Eino Kalevi Phillip Lauer - Nimbus-Mix
file:///mnt/CE64EB6A64EB53AD/music-lib/inbox-new/DJ%20Sotofett%20-%20Drippin%20For%20A%20Tripp%20(Tripp-A-Dubb-Mix)%2016-48%20FLAC/B2%20-%20Nimbus-Mix.flac

— suck m3u is parsed correctly.

@andreyponomarevru andreyponomarevru self-assigned this Dec 25, 2024
@andreyponomarevru andreyponomarevru changed the title Handle m3u playlists saved in Quod Libet correctly Handle m3u playlists containing relative paths correctly Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug type feature type high priority
Projects
None yet
Development

No branches or pull requests

1 participant