From 26cd59465c1e006dcc2d58e1c7436a306ea5a9a5 Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Mon, 20 Jan 2025 19:18:42 +0100 Subject: [PATCH] fix: make podcast subscribe icon more clear, dont allow podcasts in playlists, add onTap for radio metadata url Ref #1122 Fixes #1107 --- lib/common/view/audio_tile_option_button.dart | 3 +- lib/common/view/icons.dart | 12 +- lib/common/view/meta_data_dialog.dart | 18 + lib/player/view/player_main_controls.dart | 4 +- .../view/player_pause_timer_button.dart | 9 +- needs_translation.json | 566 ------------------ 6 files changed, 36 insertions(+), 576 deletions(-) diff --git a/lib/common/view/audio_tile_option_button.dart b/lib/common/view/audio_tile_option_button.dart index 04df90e17..84770d107 100644 --- a/lib/common/view/audio_tile_option_button.dart +++ b/lib/common/view/audio_tile_option_button.dart @@ -95,7 +95,8 @@ class AudioTileOptionButton extends StatelessWidget { ), ), ), - if (audios.none((e) => e.audioType == AudioType.radio)) + if (audios.none((e) => e.audioType == AudioType.radio) && + audios.none((e) => e.audioType == AudioType.podcast)) PopupMenuItem( onTap: () => showDialog( context: context, diff --git a/lib/common/view/icons.dart b/lib/common/view/icons.dart index b8d73240b..d4749d031 100644 --- a/lib/common/view/icons.dart +++ b/lib/common/view/icons.dart @@ -216,15 +216,15 @@ class Iconz { : Icons.settings; static IconData get addToLibrary => yaruStyled - ? YaruIcons.bell + ? YaruIcons.plus : appleStyled - ? CupertinoIcons.bell - : Icons.notifications_outlined; + ? CupertinoIcons.plus + : Icons.add; static IconData get removeFromLibrary => yaruStyled - ? YaruIcons.bell_filled + ? YaruIcons.checkmark : appleStyled - ? CupertinoIcons.bell_fill - : Icons.notifications_rounded; + ? CupertinoIcons.check_mark + : Icons.check; static IconData get refresh => yaruStyled ? YaruIcons.refresh : appleStyled diff --git a/lib/common/view/meta_data_dialog.dart b/lib/common/view/meta_data_dialog.dart index 9c6137963..a30ffc31b 100644 --- a/lib/common/view/meta_data_dialog.dart +++ b/lib/common/view/meta_data_dialog.dart @@ -1,11 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:yaru/yaru.dart'; import '../../app_config.dart'; import '../../l10n/l10n.dart'; import '../data/audio.dart'; import '../data/audio_type.dart'; +import 'copy_clipboard_content.dart'; import 'modals.dart'; +import 'snackbars.dart'; class MetaDataContent extends StatelessWidget { const MetaDataContent.dialog({ @@ -86,6 +89,21 @@ class MetaDataContent extends StatelessWidget { dense: true, title: Text(e.$1), subtitle: Text(e.$2), + onTap: e.$1 == l10n.url + ? () { + final maybeUri = Uri.tryParse(e.$2); + if (maybeUri != null) { + showSnackBar( + context: context, + content: CopyClipboardContent( + text: maybeUri.toString(), + onSearch: () => launchUrl(maybeUri), + ), + ); + Navigator.of(context).pop(); + } + } + : null, ), ) .toList(), diff --git a/lib/player/view/player_main_controls.dart b/lib/player/view/player_main_controls.dart index 48274d614..fe0861e0e 100644 --- a/lib/player/view/player_main_controls.dart +++ b/lib/player/view/player_main_controls.dart @@ -117,7 +117,9 @@ class PlayerMainControls extends StatelessWidget with WatchItMixin { active: active, iconColor: defaultColor, ), - AudioType.radio => const PlayerPauseTimerButton(), + AudioType.radio => PlayerPauseTimerButton( + iconColor: defaultColor, + ), _ => const SizedBox.shrink(), }, ]; diff --git a/lib/player/view/player_pause_timer_button.dart b/lib/player/view/player_pause_timer_button.dart index 6e8450421..c01129505 100644 --- a/lib/player/view/player_pause_timer_button.dart +++ b/lib/player/view/player_pause_timer_button.dart @@ -15,7 +15,9 @@ import '../../l10n/l10n.dart'; import '../player_model.dart'; class PlayerPauseTimerButton extends StatelessWidget { - const PlayerPauseTimerButton({super.key}); + const PlayerPauseTimerButton({super.key, this.iconColor}); + + final Color? iconColor; @override Widget build(BuildContext context) => IconButton( @@ -25,7 +27,10 @@ class PlayerPauseTimerButton extends StatelessWidget { mode: ModalMode.platformModalMode, content: isMobilePlatform ? const _BottomSheet() : const _Dialog(), ), - icon: Icon(Iconz.sleep), + icon: Icon( + Iconz.sleep, + color: iconColor, + ), ); } diff --git a/needs_translation.json b/needs_translation.json index 52665aca8..fbd37b013 100644 --- a/needs_translation.json +++ b/needs_translation.json @@ -609,569 +609,6 @@ "exposeToListenBrainzSubTitle" ], - "et": [ - "localAudio", - "localAudioDescription", - "localAudioSubtitle", - "music", - "radio", - "podcasts", - "podcast", - "likedSongs", - "likedSongsDescription", - "likedSongsSubtitle", - "cancel", - "add", - "addTo", - "deletePlaylist", - "createNewPlaylist", - "playlistDialogTitleNew", - "playlistDialogTitleEdit", - "save", - "saveAndAuthorize", - "title", - "titles", - "artist", - "artists", - "showArtistPage", - "showAlbumPage", - "album", - "albums", - "genres", - "genre", - "years", - "year", - "albumArtist", - "albumArtists", - "track", - "trackNumber", - "diskNumber", - "totalDisks", - "searchLocalAudioHint", - "library", - "playlists", - "playlist", - "discover", - "forYou", - "search", - "noPodcastFound", - "noPodcastChartsFound", - "noPodcastSubsFound", - "charts", - "upNext", - "all", - "arts", - "business", - "comedy", - "education", - "fiction", - "government", - "healthAndFitness", - "history", - "kidsAndFamily", - "leisure", - "news", - "religionAndSpirituality", - "science", - "societyAndCulture", - "sports", - "tvAndFilm", - "technology", - "trueCrime", - "offline", - "offlineDescription", - "newEpisodeAvailable", - "noStationFound", - "nothingFound", - "noStarredStations", - "tags", - "quality", - "station", - "stations", - "country", - "tag", - "failedToImport", - "unknown", - "volume", - "queue", - "limit", - "decreaseSearchLimit", - "podcastFeedIsEmpty", - "video", - "ok", - "noLocalTitlesFound", - "noLocalSearchFound", - "buyMusicOnline", - "settings", - "findUsOnGitHub", - "musicPodSubTitle", - "pickMusicCollection", - "newEpisode", - "dontShowAgain", - "queueConfirmMessage", - "emptyPlaylist", - "copiedToClipBoard", - "copyToClipBoard", - "insertIntoQueue", - "insertedIntoQueue", - "about", - "localAudioCacheSuggestion", - "noThankYou", - "recreateLocalAudioCache", - "useALocalAudioCache", - "newEpisodes", - "collection", - "addToCollection", - "removeFromCollection", - "loadingPodcastFeed", - "downloadStarted", - "downloadCancelled", - "downloadFinished", - "downloadsOnly", - "downloadsDirectory", - "downloadsDirectoryDescription", - "downloadsChangeWarning", - "moreOptions", - "noRadioServerFound", - "connectedTo", - "disconnectedFrom", - "tryReconnect", - "addedTo", - "addToPlaylist", - "open", - "removeFrom", - "noCountryFound", - "noStarredTags", - "name", - "state", - "playNext", - "contributors", - "version", - "theme", - "useMoreAnimationsTitle", - "useMoreAnimationsDescription", - "showPositionDurationTitle", - "showPositionDurationDescription", - "license", - "dependencies", - "light", - "system", - "dark", - "podcastProvider", - "iTunes", - "podcastIndex", - "usePodcastIndex", - "select", - "requiresAppRestart", - "musicCollectionLocation", - "astronomyXXXPodcastIndexOnly", - "automotiveXXXPodcastIndexOnly", - "aviationXXXPodcastIndexOnly", - "baseballXXXPodcastIndexOnly", - "basketballXXXPodcastIndexOnly", - "beautyXXXPodcastIndexOnly", - "booksXXXPodcastIndexOnly", - "buddhismXXXPodcastIndexOnly", - "careersXXXPodcastIndexOnly", - "chemistryXXXPodcastIndexOnly", - "christianityXXXPodcastIndexOnly", - "climateXXXPodcastIndexOnly", - "commentaryXXXPodcastIndexOnly", - "coursesXXXPodcastIndexOnly", - "craftsXXXPodcastIndexOnly", - "cricketXXXPodcastIndexOnly", - "cryptocurrencyXXXPodcastIndexOnly", - "cultureXXXPodcastIndexOnly", - "dailyXXXPodcastIndexOnly", - "designXXXPodcastIndexOnly", - "documentaryXXXPodcastIndexOnly", - "dramaXXXPodcastIndexOnly", - "earthXXXPodcastIndexOnly", - "entertainmentXXXPodcastIndexOnly", - "entrepreneurshipXXXPodcastIndexOnly", - "familyXXXPodcastIndexOnly", - "fantasyXXXPodcastIndexOnly", - "fashionXXXPodcastIndexOnly", - "filmXXXPodcastIndexOnly", - "fitnessXXXPodcastIndexOnly", - "foodXXXPodcastIndexOnly", - "footballXXXPodcastIndexOnly", - "gamesXXXPodcastIndexOnly", - "gardenXXXPodcastIndexOnly", - "golfXXXPodcastIndexOnly", - "healthXXXPodcastIndexOnly", - "hinduismXXXPodcastIndexOnly", - "hobbiesXXXPodcastIndexOnly", - "hockeyXXXPodcastIndexOnly", - "homeXXXPodcastIndexOnly", - "howToXXXPodcastIndexOnly", - "improvXXXPodcastIndexOnly", - "interviewsXXXPodcastIndexOnly", - "investingXXXPodcastIndexOnly", - "islamXXXPodcastIndexOnly", - "journalsXXXPodcastIndexOnly", - "judaismXXXPodcastIndexOnly", - "kidsXXXPodcastIndexOnly", - "languageXXXPodcastIndexOnly", - "learningXXXPodcastIndexOnly", - "lifeXXXPodcastIndexOnly", - "managementXXXPodcastIndexOnly", - "mangaXXXPodcastIndexOnly", - "marketingXXXPodcastIndexOnly", - "mathematicsXXXPodcastIndexOnly", - "medicineXXXPodcastIndexOnly", - "mentalXXXPodcastIndexOnly", - "naturalXXXPodcastIndexOnly", - "natureXXXPodcastIndexOnly", - "nonProfitXXXPodcastIndexOnly", - "nutritionXXXPodcastIndexOnly", - "parentingXXXPodcastIndexOnly", - "performingXXXPodcastIndexOnly", - "personalXXXPodcastIndexOnly", - "petsXXXPodcastIndexOnly", - "philosophyXXXPodcastIndexOnly", - "physicsXXXPodcastIndexOnly", - "placesXXXPodcastIndexOnly", - "politicsXXXPodcastIndexOnly", - "relationshipsXXXPodcastIndexOnly", - "religionXXXPodcastIndexOnly", - "reviewsXXXPodcastIndexOnly", - "rolePlayingXXXPodcastIndexOnly", - "rugbyXXXPodcastIndexOnly", - "runningXXXPodcastIndexOnly", - "selfImprovementXXXPodcastIndexOnly", - "sexualityXXXPodcastIndexOnly", - "soccerXXXPodcastIndexOnly", - "socialXXXPodcastIndexOnly", - "societyXXXPodcastIndexOnly", - "spiritualityXXXPodcastIndexOnly", - "standUpXXXPodcastIndexOnly", - "storiesXXXPodcastIndexOnly", - "swimmingXXXPodcastIndexOnly", - "tVXXXPodcastIndexOnly", - "tabletopXXXPodcastIndexOnly", - "tennisXXXPodcastIndexOnly", - "travelXXXPodcastIndexOnly", - "videoGamesXXXPodcastIndexOnly", - "visualXXXPodcastIndexOnly", - "volleyballXXXPodcastIndexOnly", - "weatherXXXPodcastIndexOnly", - "wildernessXXXPodcastIndexOnly", - "wrestlingXXXPodcastIndexOnly", - "updateAvailable", - "showMetaData", - "metadata", - "writeMetadata", - "reorder", - "move", - "pinAlbum", - "unPinAlbum", - "playAll", - "hearingHistory", - "emptyHearingHistory", - "searchForRadioStationsWithGenreName", - "clearPlaylist", - "editPlaylist", - "stationUrl", - "podcastFeedUrl", - "stationName", - "podcastName", - "url", - "loadFromFileOptional", - "loadMore", - "searchOnline", - "shareThisEpisode", - "downloadEpisode", - "removeDownloadEpisode", - "language", - "duration", - "radioTagDisclaimerTitle", - "radioTagDisclaimerSubTitle", - "podcastFeedLoadingTimeout", - "gitHubClientConnectError", - "replayEpisode", - "replayAllEpisodes", - "checkForUpdates", - "playbackWillStopIn", - "schedulePlaybackStopTimer", - "alwaysAsk", - "hideToTray", - "closeBtnAction", - "whenCloseBtnClicked", - "closeApp", - "closeMusicPod", - "confirmCloseOrHideTip", - "doNotAskAgain", - "skipToLivStream", - "searchSimilarStation", - "onlineArtError", - "clicks", - "exposeOnlineHeadline", - "exposeToDiscordTitle", - "exposeToDiscordSubTitle", - "exposeToLastfmTitle", - "exposeToLastfmSubTitle", - "lastfmApiKey", - "lastfmSecret", - "lastfmApiKeyEmpty", - "lastfmSecretEmpty", - "exposeToListenBrainzTitle", - "exposeToListenBrainzSubTitle", - "listenBrainzApiKey", - "listenBrainzApiKeyEmpty", - "featureDisabledOnPlatform", - "regionNone", - "regionAfghanistan", - "regionAlandislands", - "regionAlbania", - "regionAlgeria", - "regionAmericansamoa", - "regionAndorra", - "regionAngolia", - "regionAnguilla", - "regionAntarctica", - "regionAntiguaandbarbuda", - "regionArgentina", - "regionArmenia", - "regionAruba", - "regionAustralia", - "regionAustria", - "regionAzerbaijan", - "regionBahamas", - "regionBahrain", - "regionBangladesh", - "regionBarbados", - "regionBelarus", - "regionBelgium", - "regionBelize", - "regionBenin", - "regionBermuda", - "regionBhutan", - "regionBolivia", - "regionBonaire", - "regionBosniaandherzegovina", - "regionBotswana", - "regionBouvetisland", - "regionBrazil", - "regionBritishindianoceanterrirory", - "regionBritishvirginislands", - "regionBruneidarussalam", - "regionBulgaria", - "regionBurkinafaso", - "regionBurundi", - "regionCaboverde", - "regionCambodia", - "regionCameroon", - "regionCanada", - "regionCaymanislands", - "regionCentralafricanrepublic", - "regionChad", - "regionChile", - "regionChina", - "regionChristmasisland", - "regionCocosislands", - "regionColombia", - "regionComoros", - "regionCongo", - "regionCongodemocraticrepublicof", - "regionCookislands", - "regionCostarica", - "regionCotedivoire", - "regionCroatia", - "regionCuba", - "regionCuracao", - "regionCyprus", - "regionCzechia", - "regionDenmark", - "regionDjibouti", - "regionDominica", - "regionDominicanrepublic", - "regionEcuador", - "regionEgypt", - "regionElsalvador", - "regionEquatorialguinea", - "regionEritrea", - "regionEstonia", - "regionEthiopia", - "regionFalklandislands", - "regionFaroeislands", - "regionFiji", - "regionFinland", - "regionFrance", - "regionFrenchguiana", - "regionFrenchpolynesia", - "regionFrenchsouthernterritories", - "regionGabon", - "regionGambia", - "regionGeorgia", - "regionGermany", - "regionGhana", - "regionGibraltar", - "regionGreece", - "regionGreenland", - "regionGrenada", - "regionGuadeloupe", - "regionGuam", - "regionGuatemala", - "regionGuernsey", - "regionGuinea", - "regionGuineabissau", - "regionGuyana", - "regionHaiti", - "regionHeardislandandmcdonaldislands", - "regionHonduras", - "regionHongkong", - "regionHungary", - "regionIceland", - "regionIndia", - "regionIndonesia", - "regionIran", - "regionIraq", - "regionIreland", - "regionIsleofman", - "regionIsrael", - "regionItaly", - "regionJamaica", - "regionJapan", - "regionJersey", - "regionJordan", - "regionKazakhstan", - "regionKenya", - "regionKiribati", - "regionKuwait", - "regionKyrgyzstan", - "regionLaos", - "regionLatvia", - "regionLebanon", - "regionLesotho", - "regionLiberia", - "regionLibya", - "regionLiechtenstein", - "regionLithuania", - "regionLuxembourg", - "regionMacao", - "regionMacedonia", - "regionMadagascar", - "regionMalawi", - "regionMalaysia", - "regionMaldives", - "regionMali", - "regionMalta", - "regionMarshallislands", - "regionMartinique", - "regionMauritania", - "regionMauritius", - "regionMayotte", - "regionMexico", - "regionMicronesia", - "regionMoldova", - "regionMonaco", - "regionMongolia", - "regionMontenegro", - "regionMontserrat", - "regionMorocco", - "regionMozambique", - "regionMyanmar", - "regionNamibia", - "regionNauru", - "regionNepal", - "regionNetherlands", - "regionNewcaledonia", - "regionNewzealand", - "regionNicaragua", - "regionNiger", - "regionNigeria", - "regionNiue", - "regionNorfolkisland", - "regionNorthkorea", - "regionNorthernmarianaislands", - "regionNorway", - "regionOman", - "regionPakistan", - "regionPalau", - "regionPalestine", - "regionPanama", - "regionPapuanewguinea", - "regionParaguay", - "regionPeru", - "regionPhilippines", - "regionPitcairn", - "regionPoland", - "regionPortugal", - "regionPuertorico", - "regionQatar", - "regionReunion", - "regionRomania", - "regionRussianfederation", - "regionRwanda", - "regionSaintbarthelemy", - "regionSainthelena", - "regionSaintkittsandnevis", - "regionSaintlucia", - "regionSaintmartin", - "regionSaintpierreandmiquelon", - "regionSaintvincentandthegrenadines", - "regionSamoa", - "regionSanmarino", - "regionSaotomeandprincipe", - "regionSaudiarabia", - "regionSenegal", - "regionSerbia", - "regionSeychelles", - "regionSierraleone", - "regionSingapore", - "regionSintmaarten", - "regionSlovakia", - "regionSlovenia", - "regionSolomonislands", - "regionSomalia", - "regionSouthafrica", - "regionSouthgeorgiaandthesouthsandwichislands", - "regionSouthkorea", - "regionSouthsudan", - "regionSpain", - "regionSrilanka", - "regionSudan", - "regionSuriname", - "regionSvalbardandjanmayen", - "regionSwaziland", - "regionSweden", - "regionSwitzerland", - "regionSyrianarabrepublic", - "regionTaiwan", - "regionTajikistan", - "regionTanzania", - "regionThailand", - "regionTimorleste", - "regionTogo", - "regionTokelau", - "regionTonga", - "regionTrinidadandtobago", - "regionTunisia", - "regionTurkey", - "regionTurkmenistan", - "regionTurksandcaicosislands", - "regionTuvalu", - "regionUganda", - "regionUkraine", - "regionUnitedarabemirates", - "regionUnitedkingdom", - "regionUnitedstates", - "regionUnitedstatesminoroutlyingislands", - "regionUruguay", - "regionUsvirginislands", - "regionUzbekistan", - "regionVanuatu", - "regionVaticancity", - "regionVenezuela", - "regionVietnam", - "regionWallisandfutuna", - "regionWesternsahara", - "regionYemen", - "regionZambia", - "regionZimbabwe" - ], - "nl": [ "home", "showArtistPage", @@ -2868,9 +2305,6 @@ ], "ru": [ - "home", - "showArtistPage", - "showAlbumPage", "clicks", "regionAruba", "regionAustralia",