Navidrome-Integration, Widgets (Recent + Tag-Statistik)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
class Playlist {
|
||||
final int? id;
|
||||
final String name;
|
||||
final String erstelltAm;
|
||||
int songCount;
|
||||
|
||||
Playlist({
|
||||
this.id,
|
||||
required this.name,
|
||||
String? erstelltAm,
|
||||
this.songCount = 0,
|
||||
}) : erstelltAm = erstelltAm ?? DateTime.now().toIso8601String();
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'erstellt_am': erstelltAm,
|
||||
};
|
||||
|
||||
factory Playlist.fromMap(Map<String, dynamic> m, {int songCount = 0}) => Playlist(
|
||||
id: m['id'] as int?,
|
||||
name: m['name'] as String,
|
||||
erstelltAm: m['erstellt_am'] as String?,
|
||||
songCount: songCount,
|
||||
);
|
||||
}
|
||||
+5
-1
@@ -19,4 +19,8 @@ class Tag {
|
||||
icon: m['icon'] as String?,
|
||||
farbeHex: m['farbe_hex'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, String> toDisplay() => {
|
||||
'name': name,
|
||||
'icon': icon ?? '',
|
||||
};}
|
||||
|
||||
Reference in New Issue
Block a user