update sfm stream url, add album to webhook np message

This commit is contained in:
codey 2025-03-10 10:00:23 -04:00
parent 7bda7c3a8f
commit 6ef38f17a7
2 changed files with 49 additions and 40 deletions

7
.gitignore vendored
View File

@ -10,4 +10,9 @@ db_migrate.py
notifier.py
youtube*
playlist_creator.py
artist_genre_tag.py
artist_genre_tag.py
uv.lock
py.typed
pyproject.toml
mypy.ini
.python-version

View File

@ -146,41 +146,41 @@ class RadioUtil:
LIMITED GENRES
"""
db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
WHERE (genre LIKE "%metalcore%"\
OR genre LIKE "%rock%"\
OR genre LIKE "%pop punk%"\
OR genre LIKE "%math rock%"\
OR genre LIKE "%punk rock%"\
OR genre LIKE "%metal%"\
OR genre LIKE "%punk%"\
OR genre LIKE "%electronic%"\
OR genre LIKE "%nu metal%"\
OR genre LIKE "%EDM%"\
OR genre LIKE "%post-hardcore%"\
OR genre LIKE "%pop rock%"\
OR genre LIKE "%experimental%"\
OR genre LIKE "%post-punk%"\
OR genre LIKE "%death metal%"\
OR genre LIKE "%electronicore%"\
OR genre LIKE "%hard rock%"\
OR genre LIKE "%psychedelic rock%"\
OR genre LIKE "%grunge%"\
OR genre LIKE "%house%"\
OR genre LIKE "%dubstep%"\
OR genre LIKE "%hardcore%"\
OR genre LIKE "%hair metal%"\
OR genre LIKE "%horror punk%"\
OR genre LIKE "%folk punk%"\
OR genre LIKE "%breakcore%"\
OR genre LIKE "%post-rock%"\
OR genre LIKE "%deathcore%"\
OR genre LIKE "%hardcore punk%"\
OR genre LIKE "%synthwave%"\
OR genre LIKE "%trap%"\
OR genre LIKE "%indie pop%"\
OR genre LIKE "%dnb%")\
GROUP BY artistdashsong ORDER BY RANDOM()"""
# db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
# WHERE (genre LIKE "%metalcore%"\
# OR genre LIKE "%rock%"\
# OR genre LIKE "%pop punk%"\
# OR genre LIKE "%math rock%"\
# OR genre LIKE "%punk rock%"\
# OR genre LIKE "%metal%"\
# OR genre LIKE "%punk%"\
# OR genre LIKE "%electronic%"\
# OR genre LIKE "%nu metal%"\
# OR genre LIKE "%EDM%"\
# OR genre LIKE "%post-hardcore%"\
# OR genre LIKE "%pop rock%"\
# OR genre LIKE "%experimental%"\
# OR genre LIKE "%post-punk%"\
# OR genre LIKE "%death metal%"\
# OR genre LIKE "%electronicore%"\
# OR genre LIKE "%hard rock%"\
# OR genre LIKE "%psychedelic rock%"\
# OR genre LIKE "%grunge%"\
# OR genre LIKE "%house%"\
# OR genre LIKE "%dubstep%"\
# OR genre LIKE "%hardcore%"\
# OR genre LIKE "%hair metal%"\
# OR genre LIKE "%horror punk%"\
# OR genre LIKE "%folk punk%"\
# OR genre LIKE "%breakcore%"\
# OR genre LIKE "%post-rock%"\
# OR genre LIKE "%deathcore%"\
# OR genre LIKE "%hardcore punk%"\
# OR genre LIKE "%synthwave%"\
# OR genre LIKE "%trap%"\
# OR genre LIKE "%indie pop%"\
# OR genre LIKE "%dnb%")\
# GROUP BY artistdashsong ORDER BY RANDOM()"""
"""
LIMITED TO ONE/SMALL SUBSET OF GENRES
@ -193,8 +193,8 @@ class RadioUtil:
LIMITED TO ONE/SOME ARTISTS...
"""
# db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
# WHERE artist LIKE "%sullivan king%" GROUP BY artistdashsong ORDER BY artist ASC, album ASC, id DESC'
db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\
WHERE artist LIKE "%chunk! n%" GROUP BY artistdashsong ORDER BY artist ASC, album ASC, id DESC'
async with sqlite3.connect(self.active_playlist_path,
timeout=2) as db_conn:
@ -359,9 +359,13 @@ class RadioUtil:
},
{
"name": "Higher Res",
"value": "[stream/icecast](https://relay.sfm.codey.lol/aces.ogg) | [web player](https://codey.lol/radio)",
"value": "[stream/icecast](https://stream.codey.lol/sfm.ogg) | [web player](https://codey.lol/radio)",
"inline": True,
}
},
{
"name": "Album",
"value": track['album'] if track['album'] else "Unknown",
},
]
}]
}