Skip to content

Commit

Permalink
Code review fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Komodo5197 committed Feb 20, 2024
1 parent 62b4df4 commit eaa9d80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@
},
"downloadSettings": "Download Settings",
"@downloadSettings": {},
"showNullLibraryItemsTitle": "Show Items with Unknown Library.",
"showNullLibraryItemsTitle": "Show Media with Unknown Library.",
"@showNullLibraryItemsTitle": {
"description": "Title of setting that shows songs/albums from an unknown library in all libraries when on, or in no libraries when off."
},
"showNullLibraryItemsSubtitle": "Some items may be downloaded with an unknown library. They can show in all libraries, or none.",
"showNullLibraryItemsSubtitle": "Some media may be downloaded with an unknown library. Turn off to hide these outside their original collection.",
"@showNullLibraryItemsSubtitle": {
"description": "Description of setting that shows songs/albums from an unknown library in all libraries when on, or in no libraries when off."
},
Expand Down Expand Up @@ -1183,7 +1183,7 @@
},
"description": "Dropdown option to download transcoded version of songs"
},
"downloadInfo": "{size} {codec} @ {bitrate, select, null{} other{{bitrate} Transcoded}}",
"downloadInfo": "{size} {codec}{bitrate, select, null{} other{ @ {bitrate} Transcoded}}",
"@downloadInfo": {
"placeholders": {
"bitrate": {
Expand All @@ -1201,7 +1201,7 @@
},
"description": "Song info line in downloads screen lists"
},
"collectionDownloadInfo": "{size} {codec, select, ORIGINAL{} other{ as {codec} @ {bitrate}}}",
"collectionDownloadInfo": "{size}{codec, select, ORIGINAL{} other{ as {codec} @ {bitrate}}}",
"@collectionDownloadInfo": {
"placeholders": {
"bitrate": {
Expand Down
7 changes: 5 additions & 2 deletions lib/services/downloads_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1289,13 +1289,15 @@ class DownloadsService {
}

/// Get information about a downloaded song by BaseItemDto or id.
/// Exactly one of the two arguments should be provided.
Future<DownloadStub?> getSongInfo({BaseItemDto? item, String? id}) {
assert((item == null) != (id == null));
return _isar.downloadItems
.get(DownloadStub.getHash(id ?? item!.id, DownloadItemType.song));
}

/// Get information about a downloaded collection by BaseItemDto or id.
/// Exactly one of the two arguments should be provided.
Future<DownloadStub?> getCollectionInfo({BaseItemDto? item, String? id}) {
assert((item == null) != (id == null));
return _isar.downloadItems
Expand All @@ -1305,15 +1307,16 @@ class DownloadsService {
/// Get a song's DownloadItem by BaseItemDto or id. This method performs file
/// verification and should only be used when the downloaded file is actually
/// needed, such as when building MediaItems. Otherwise, [getSongInfo] should
/// be used instead.
/// be used instead. Exactly one of the two arguments should be provided.
Future<DownloadItem?> getSongDownload({BaseItemDto? item, String? id}) {
assert((item == null) != (id == null));
return _getDownloadByID(id ?? item!.id, DownloadItemType.song);
}

/// Get an image's DownloadItem by BaseItemDto or id. This method performs file
/// verification and should only be used when the downloaded file is actually
/// needed, such as when building ImageProviders.
/// needed, such as when building ImageProviders. Exactly one of the two arguments
/// should be provided.
Future<DownloadItem?> getImageDownload(
{BaseItemDto? item, String? blurHash}) {
assert((item?.blurHash == null) != (blurHash == null));
Expand Down

0 comments on commit eaa9d80

Please sign in to comment.