mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
rewrite migrations
+ delete older migrations ... oops + change migratrions from "migrations" to "dbmigrations" + restructure migrations, order them based on release version + add a utils/decorators.py file with a coroutine decorator
This commit is contained in:
@@ -25,3 +25,4 @@ def date_string_to_time_passed(prev_date: str) -> str:
|
||||
|
||||
now = pendulum.now()
|
||||
return now.subtract(seconds=seconds).diff_for_humans()
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
def coroutine(func):
|
||||
"""
|
||||
Decorator: primes `func` by advancing to first `yield`
|
||||
"""
|
||||
|
||||
def start(*args, **kwargs):
|
||||
cr = func(*args, **kwargs)
|
||||
next(cr)
|
||||
return cr
|
||||
|
||||
return start
|
||||
@@ -211,7 +211,7 @@ def get_base_title_and_versions(
|
||||
Extracts the base album title and version info from an album title string using regex.
|
||||
"""
|
||||
album_title, version_block = get_base_album_title(original_album_title)
|
||||
|
||||
|
||||
if version_block is None:
|
||||
return original_album_title, []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user