From 889423518e3c0fe06c69d073e8281cc7e0615a98 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Mon, 21 Nov 2022 15:44:59 +0100 Subject: [PATCH] continued --- src/music_kraken/database/song.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/music_kraken/database/song.py b/src/music_kraken/database/song.py index dd31023..2d88acd 100644 --- a/src/music_kraken/database/song.py +++ b/src/music_kraken/database/song.py @@ -5,12 +5,24 @@ class Artist: self.id = self.artist_data['id'] self.name = self.artist_data['name'] +class Source: + def __init__(self, src_data) -> None: + self.src_data = src_data + + self.src = self.src_data['src'] + self.url = self.src_data['url'] + class Song: def __init__(self, json_response) -> None: self.json_data = json_response self.artists = [Artist(a) for a in self.json_data['artists']] + self.sources = [] + for src in self.json_data['source']: + if src['src'] is None: + continue + self.sources.append(Source(src)) """ artist source