Skip to content

Commit

Permalink
Don't error when a playlist has no modification date (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abestanis authored Oct 13, 2024
1 parent d64c763 commit 98c8c9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/logic/models/playlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ class Playlist extends PersistentQueue with DuplicatingSongOriginMixin implement
}

factory Playlist.fromMap(Map<String, dynamic> map) {
int dateAdded = map['dateAdded'] as int;
return Playlist(
id: map['id'] as int,
filesystemPath: map['filesystemPath'] as String,
dateAdded: map['dateAdded'] as int,
dateModified: map['dateModified'] as int,
dateAdded: dateAdded,
dateModified: map['dateModified'] as int? ?? dateAdded,
name: map['name'] as String,
songIds: (map['songIds'] as List).cast<int>().toList(),
);
Expand Down

0 comments on commit 98c8c9b

Please sign in to comment.