{"id":19700191,"url":"https://github.com/dbeley/playlist-versioning","last_synced_at":"2025-04-29T13:31:41.424Z","repository":{"id":40599290,"uuid":"342661078","full_name":"dbeley/playlist-versioning","owner":"dbeley","description":"My playlists under version control.","archived":false,"fork":false,"pushed_at":"2024-11-04T19:01:46.000Z","size":1650,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-04T20:18:07.288Z","etag":null,"topics":["playlist","playlists"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbeley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-26T18:11:49.000Z","updated_at":"2024-11-04T19:01:50.000Z","dependencies_parsed_at":"2024-05-01T06:26:27.056Z","dependency_job_id":"59dd0423-59ff-4ca1-98d2-77a4f31d0d28","html_url":"https://github.com/dbeley/playlist-versioning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Fplaylist-versioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Fplaylist-versioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Fplaylist-versioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Fplaylist-versioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbeley","download_url":"https://codeload.github.com/dbeley/playlist-versioning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224175749,"owners_count":17268390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["playlist","playlists"],"created_at":"2024-11-11T21:04:39.528Z","updated_at":"2024-11-11T21:04:40.070Z","avatar_url":"https://github.com/dbeley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playlists\n\nMy playlists under version control.\n\n## Requirements\n\n- mpd (with your library imported)\n- mpc\n- python\n- bash\n- a list of your favorite tracks\n- a list of artists linked to a playlist (see below)\n\nLimitations:\n- all the tracks of an artist are grouped and will be added to the same playlists\n- mpc query language is quite limited and only support exact matches\n\n## MPD matching\n\nCreate a text file (for example `files/00_favorites-tracks.txt`) containing your favorite tracks (one by line, with the format `ARTIST - TRACK`):\n```\nARTIST1 - FAVORITE_TRACK1\nARTIST1 - FAVORITE_TRACK2\nARTIST2 - FAVORITE_TRACK3\nARTIST3 - FAVORITE_TRACK4\n...\n```\n\nI personnaly export all my favorite tracks on last.fm with [this script](https://github.com/dbeley/lastfm-scraper/blob/master/lastfm-all_favorite_tracks.py).\n\nRun the `mplaylist.sh` script:\n```\n./mplaylist.sh files/00_favorites-tracks.txt\n```\n\nOutput:\n- `files/04_result-mplaylist.csv`: tracks matched with mpc\n- `files/05_result-mplaylist-missing.csv`: tracks not matched with mpc\n\n## Playlist creation\n\nYou will need three files:\n\n- `files/01_playlists.csv` (fields: `playlist_id;playlist_name`):\n```\n1;Rock\n2;Pop\n```\n\n- `files/02_artists.csv` (fields: `playlist_id;artist_name`):\n```\n1;ARTIST1\n1;ARTIST3\n2;ARTIST2\n2;ARTIST1\n```\n\nThose two files says \"ARTIST1 and ARTIST3 songs will be added to the playlist Rock, and ARTIST1 and ARTIST2 songs to the Pop playlist\".\n\nAdding artists in multiple playlists is supported, just duplicate the entries with a different playlist id.\n\n- `files/06_fix-missing-tracks.csv`: manually add paths for the missing tracks in `05_result-mplaylist-missing.csv` (fields: `missing_track;path`):\n```\nARTIST1 - MISSING_TRACK1;PATH_TO_TRACK1\nARTIST2 - MISSING_TRACK2;PATH_TO_TRACK2\nARTIST2 - MISSING_TRACK3;PATH_TO_TRACK3\nARTIST3 - MISSING_TRACK4;PATH_TO_TRACK4\n```\n\nRun the `create_playlists.py` script (change the **LOCAL_BASEPATH** and **BASEPATH** global variable to your own):\n```\npython create_playlists.py\n```\n\n**BASEPATH** indicates what the mpd matched tracks will be prefixed with. It's used to complete the paths as mpd uses internal paths and not full paths.\n\n**LOCAL_BASEPATH** indicates the base path to delete after checking the validity of the manually inserted paths in `06_fix-missing-tracks.csv`. The **BASEPATH** will then be used as a prefix.\n\nBy setting **BASEPATH** to `/music/` and **LOCAL_BASEPATH** to `/home/user/nfs/Musique/`, the script will delete `/home/user/nfs/Musique/` from the paths found in `06_fix-missing-tracks.csv` and will create playlists using `/music/` as base path.\nIf you want to use your playlists on the same filesystem configuration, you can set **LOCAL_BASEPATH** and **BASEPATH** to the same value.\n\nOutput:\n- `files/03_artists_NOT-FOUND.csv`: artists not found in `02_artists.csv`\n- `files/07_fix-missing-tracks_NOT-FOUND.csv`: missing tracks not found in `06_fix-missing-tracks.csv`\n\nIf those files are empty you're good, otherwise just add entries in `02_artists.csv` or `06_fix-missing-tracks.csv` and restart the script `create_playlists.py`.\n\nExported playlists will be in the `playlists` folder.\n\n## Import\n\nI automatically import those playlists into airsonic (airsonic can watch and import playlists from a folder).\n\nMy music folder is mounted under the `/music/` folder in my airsonic container (hence the `/music/` prefix in `create_playlists.py`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Fplaylist-versioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbeley%2Fplaylist-versioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Fplaylist-versioning/lists"}