Afegir temes coocurrents
This commit is contained in:
@@ -35,3 +35,11 @@ def temes_compute_stats(temes: Iterable[model.Tema]) -> list[model.Tema]:
|
||||
tema_ids = [tema.id for tema in temes if tema.id is not None]
|
||||
tune_sessions_dict = playlists_q.get_tune_sessions(tema_ids=tema_ids)
|
||||
return [tema_compute_stats(tema=tema, tune_sessions_dict=tune_sessions_dict) for tema in temes]
|
||||
|
||||
|
||||
def tema_compute_played_with(
|
||||
tema: model.Tema,
|
||||
) -> model.Tema:
|
||||
if tema.id:
|
||||
tema.played_with = playlists_q.get_commonly_played_tunes(tema_id=tema.id)
|
||||
return tema
|
||||
|
||||
Reference in New Issue
Block a user