New metadata.album_review config setting (#216)

* add `get_album_review` endpoint

* add `metadata.album_review` config option

* add comment to `add_track_metadata`

* move `AlbumReview` model to its own file and clean up imports

* fix API endpoint for fetching album reviews

* add normalized_text method to AlbumReview model for text processing

* add unit test for `normalize_review_text` function and refactor `AlbumReview` model

* add `album_review` to metadata

* update comment

* add comment
This commit is contained in:
Oskar Dudziński
2025-11-13 13:38:04 +01:00
committed by GitHub
parent e0fe7e1655
commit 96fb746fd9
9 changed files with 75 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
from tiddl.core.api.models.review import normalize_review_text
def test_normalize_review_text():
text_before = 'Dropping on Halloween of 2017 with only a single day\'s advance notice, [wimpLink albumId="80611906"]Without Warning[/wimpLink] is a collaborative full-length between [wimpLink artistId="7279286"]21 Savage[/wimpLink], [wimpLink artistId="3958646"]Offset[/wimpLink] (of [wimpLink artistId="5024748"]Migos[/wimpLink]), and producer [wimpLink artistId="5012586"]Metro Boomin[/wimpLink], three of the most successful rap artists of the year. The release plays up its Halloween theme, with [wimpLink artistId="5012586"]Metro Boomin[/wimpLink] filling the tracks with scary sound effects and ominous beats, and the MCs delivering ghastly, violent lyrics. [wimpLink artistId="5198891"]Travis Scott[/wimpLink] and [wimpLink artistId="5906497"]Quavo[/wimpLink] contribute guest verses, and additional producers include Dre Moon, [wimpLink artistId="25917"]Southside[/wimpLink], and Cubeatz. [wimpLink albumId="80611906"]Without Warning[/wimpLink] was an immediate success, hitting the Top Five of the Billboard 200 albums chart following its release.'
text_after = "Dropping on Halloween of 2017 with only a single day's advance notice, Without Warning is a collaborative full-length between 21 Savage, Offset (of Migos), and producer Metro Boomin, three of the most successful rap artists of the year. The release plays up its Halloween theme, with Metro Boomin filling the tracks with scary sound effects and ominous beats, and the MCs delivering ghastly, violent lyrics. Travis Scott and Quavo contribute guest verses, and additional producers include Dre Moon, Southside, and Cubeatz. Without Warning was an immediate success, hitting the Top Five of the Billboard 200 albums chart following its release."
assert normalize_review_text(text=text_before) == text_after