Skip to content

Commit

Permalink
updated download_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Mar 2, 2023
1 parent c01f850 commit d12dcde
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 43 deletions.
2 changes: 0 additions & 2 deletions lib/localization/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Cache leeren",
"clearSearchHistory": "Suchverlauf löschen",
"downloadAppUpdate": "Update herunterladen",
"downloadCompleted": "Download abgeschlossen",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download gestartet",
"downloadedSongs": "Heruntergeladene Lieder",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "Falsch",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Clear cache",
"clearSearchHistory": "Clear Search History",
"downloadAppUpdate": "Download app update",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Limpiar cache",
"clearSearchHistory": "Limpiar historial de búsqueda",
"downloadAppUpdate": "Descargar actualización de la aplicación",
"downloadCompleted": "Descarga completada",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Carpeta de canciones descargadas",
"downloadStarted": "La descarga ha empezado",
"downloadedSongs": "Se an descargado las canciones",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Vider le cache",
"clearSearchHistory": "Effacer l'historique",
"downloadAppUpdate": "Télécharger la mise à jour de l'application",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_he.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Clear cache",
"clearSearchHistory": "Clear Search History",
"downloadAppUpdate": "Download app update",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_hi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Clear cache",
"clearSearchHistory": "Clear Search History",
"downloadAppUpdate": "Download app update",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_hu.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Clear cache",
"clearSearchHistory": "Clear Search History",
"downloadAppUpdate": "Download app update",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_id.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Hapus cache",
"clearSearchHistory": "Hapus Riwayat Pencarian",
"downloadAppUpdate": "Unduh pembaruan aplikasi",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_it.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Pulisci cache",
"clearSearchHistory": "Cancella cronologia delle ricerche",
"downloadAppUpdate": "Scaricata l'aggiornamento dell'app",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_ka.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "ქეშის გასუფთავება",
"clearSearchHistory": "საძიებო ისტორიის გასუფთავება",
"downloadAppUpdate": "აპლიკაციის განახლების ჩამოტვირთვა",
"downloadCompleted": "ჩამოტვირთვა დასრულდა",
"downloadFailed": "Download failed",
"downloadSongsFolder": "ჩამოტვირთული სიმღერების საქაღალდე",
"downloadStarted": "ჩამოტვირთვა დაიწყო",
"downloadedSongs": "ჩამოტვირთული სიმღერები",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "მცდარი",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_nl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Cache wissen",
"clearSearchHistory": "Verwijder zoekgeschiedenis",
"downloadAppUpdate": "App-update downloaden",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Wyczyść pamięć podręczną",
"clearSearchHistory": "Wyczyść historię wyszukiwania",
"downloadAppUpdate": "Pobierz aktualizację aplikacji",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Limpar cache",
"clearSearchHistory": "Limpar histórico de pesquisa",
"downloadAppUpdate": "Baixar atualização do aplicativo",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Pasta de Músicas Baixadas",
"downloadStarted": "Download Started",
"downloadedSongs": "Músicas Baixadas",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Очистить кэш",
"clearSearchHistory": "Очистить историю поиска",
"downloadAppUpdate": "Скачать обновление",
"downloadCompleted": "Скачивание завершено",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Скачивание начато",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "Ложь",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_tr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Önbelleği temizle",
"clearSearchHistory": "Arama geçmişini temizle",
"downloadAppUpdate": "Uygulama güncellemesini indirin",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "İndirilen şarkılar",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "Yanlış",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_uk.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "Очистити кеш",
"clearSearchHistory": "Очистити iсторiю пошуку",
"downloadAppUpdate": "Завантажити оновлення програми",
"downloadCompleted": "Завантаження завершено",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Каталог завантажених пісень",
"downloadStarted": "Завантаження розпочато",
"downloadedSongs": "Завантажені пісні",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "Хиба",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "清除缓存",
"clearSearchHistory": "清除搜索历史",
"downloadAppUpdate": "下载应用更新",
"downloadCompleted": "Download Completed",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "Download Started",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "False",
Expand Down
2 changes: 0 additions & 2 deletions lib/localization/app_zh_TW.arb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"clearCache": "清除快取",
"clearSearchHistory": "清除搜尋記錄",
"downloadAppUpdate": "下載應用程式更新",
"downloadCompleted": "下載完成",
"downloadFailed": "Download failed",
"downloadSongsFolder": "Download Songs Folder",
"downloadStarted": "下載開始",
"downloadedSongs": "Downloaded songs",
"errorWhileRequestingPerms": "Error while requesting permissions",
"falseMSG": "否",
Expand Down
10 changes: 3 additions & 7 deletions lib/services/download_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Future<void> downloadSong(BuildContext context, dynamic song) async {

final filename = song['more_info']['singers'] +
' - ' +
song['title'].replaceAll(invalidCharacters, '').replaceAll(' ', '');
final filepath =
'$downloadDirectory/$filename.${prefferedFileExtension.value}';
song['title'].replaceAll(invalidCharacters, '').replaceAll(' ', '') +
'.${prefferedFileExtension.value}';
final filepath = '$downloadDirectory/$filename';

lastDownloadedSongIdListener.value = song['ytid'];

Expand Down Expand Up @@ -60,10 +60,6 @@ Future<void> downloadFileFromYT(
showNotification: true,
openFileFromNotification: true,
);

showToast(
AppLocalizations.of(context)!.downloadCompleted,
);
} catch (e) {
debugPrint('Error while downloading song: $e');
showToast(
Expand Down

0 comments on commit d12dcde

Please sign in to comment.