swingmx / swingmusic

Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
https://swingmx.com
MIT License
755 stars 41 forks source link

Adding new playlists by importing `m3u` files #197

Open sortedcord opened 6 months ago

sortedcord commented 6 months ago

It can be quite a chore to add tracks to your playlist manually by looking up each and every track, especially if they existed on another application that allows the exporting of playlists by generating a .m3u playlist file.

Todo:

Currently it can matches tracks on two paramters:

  1. Duration, File name, Artist name present in the m3u file
  2. Duration, Track title, Artist Name present in the m3u file

I've implemented a get_tracks_containing_filepaths getter function in app/store/tracks.py. There's probably a better way to implement that, but I couldn't think of it while testing all of this out, so that needs to be changed along with a lot of other small things within the PR.

Duration matching can be seen as redundant but is especially important for things like VIP remixes, where they belong to the same artist and have similar titles but are two different tracks.