From 0e75118416f458b63969c315193de41bcfcf91d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Mon, 30 Jan 2023 09:47:50 +0100 Subject: [PATCH] feat(streams): remove unicode from playlist names --- lib/streams.nix | 86 ++++++++++++++++++++--------------------- systems/zaatar/tuna.nix | 4 +- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/lib/streams.nix b/lib/streams.nix index aaf7a72..6d7c939 100644 --- a/lib/streams.nix +++ b/lib/streams.nix @@ -3,49 +3,49 @@ # soma.fm generated via: curl https://somafm.com/ | pup '.cbshort json{}' | jq 'map({logo:.children[0].children[0].src|sub("^"; "http://soma.fm"), desc: .children[2].text, station: .children[1].text})' let tags = { - ambient = "🧘 Ambient"; - american = "🇺🇸 USA"; - amro = "👦 Amro"; - arabic = "🇱🇧 عربي"; - balkan = "🇧🇦 Balkan"; - berlin = "🐻 Berlin"; - brazilian = "🇧🇷 Brasil"; - chill = "🧊 Chill"; - chinese = "🇨🇳 中国"; - classical = "🎻 Classical"; - discover = "😲 Discover"; - danish = "🇩🇰 Dansk"; - dnb = "🥁 DnB"; - dubstep = "🎆 Dubstep"; - french = "🇫🇷 France"; - geschepper = "🤯 Geschepper"; - greek = "🇬🇷 Ελλάδα"; - greenlandic = "🇬🇱 Kalaallit Nunaat"; - groovy = "🕺 Groovy"; - holy = "⛪ Holy"; - indian = "🇮🇳 भारत"; - irie = "🇯🇲 Irie"; - irish = "🇮🇪 Éire"; - jazz = "🎷 Jazz"; - lofi = "✍ Lo-Fi"; - metal = "🤘 Metal"; - party = "🪩 Party"; - pop = "🎙 Pop"; - radiorecord = "⏺ Record"; - rap = "💸 Rap"; - rock = "🎸 Rock"; - russian = "🇷🇺 Россия"; - schlager = "💩 Schlager"; - soma = "🍄 σῶμα – सोमः"; - text = "📚 Text"; - top40 = "♻️ Top 40"; - trad = "👘 Trad"; - trance = "🎇 Trance"; - trap = "🪤 Trap"; - turkish = "🇹🇷 Türkiye"; - vintage = "🕰️ Vintage"; - wave = "🌊 WAVE"; - xmas = "🎅 Christmas"; + ambient = "ambient"; + american = "american"; + amro = "dj_amro"; + arabic = "arabi"; + balkan = "balkan"; + berlin = "berlin"; + brazilian = "brasil"; + chill = "chill"; + chinese = "china"; + classical = "classical"; + discover = "discover"; + danish = "denmark"; + dnb = "dnb"; + dubstep = "dubstep"; + french = "france"; + geschepper = "geschepper"; + greek = "greece"; + greenlandic = "greenland"; + groovy = "groovy"; + holy = "holy"; + indian = "india"; + irie = "jamaica"; + irish = "ireland"; + jazz = "jazz"; + lofi = "lofi"; + metal = "metal"; + party = "party"; + pop = "pop"; + radiorecord = "radiorecord"; + rap = "rap"; + rock = "rock"; + russian = "russia"; + schlager = "schlager"; + soma = "soma"; + text = "text"; + top40 = "top40"; + trad = "trad"; + trance = "trance"; + trap = "trap"; + turkish = "turkey"; + vintage = "vintage"; + wave = "wave"; + xmas = "xmas"; }; # https://github.com/NixOS/nixpkgs/blob/bc06c93905f60a82d6ebbb78f78cf289257860cc/lib/trivial.nix#L281-L282 diff --git a/systems/zaatar/tuna.nix b/systems/zaatar/tuna.nix index ed88d25..4e8c0b6 100644 --- a/systems/zaatar/tuna.nix +++ b/systems/zaatar/tuna.nix @@ -72,6 +72,8 @@ in { extraStopCommands = firewall.removeRules rules; }; + # to reset: + # ssh zaatar 'rm /var/lib/mpd/playlists/*.m3u && systemd-tmpfiles --create' systemd.tmpfiles.rules = let tags = lib.lists.unique (lib.concatMap ({tags ? [], ...}: tags) streams); tagStreams = tag: lib.filter ({tags ? [], ...}: lib.elem tag tags) streams; @@ -93,7 +95,7 @@ in { mode = "0644"; user = "mpd"; group = "mpd"; - path = "/var/lib/mpd/playlist/all.m3u"; + path = "/var/lib/mpd/playlists/all.m3u"; argument = makePlaylist "all" streams; }) ];