Compare commits

...

5 Commits

Author SHA1 Message Date
Guanciottaman
4b17c36aac
Merge ff252d6b14 into b74c2eab8f 2025-03-28 21:20:44 +06:00
Kingkor Roy Tirtho
b74c2eab8f fix: calling /track/:streamId endpoint causes active sourced track to be anything 2025-03-28 20:57:46 +06:00
Guanciottaman
ff252d6b14
Merge branch 'dev' into patch-1 2024-06-03 16:26:24 +02:00
Guanciottaman
195cad8f39
Update app_it.arb fixing translations 2024-03-27 20:54:18 +01:00
Guanciottaman
19f525fa3c
Update app_it.arb
Made the translations more friendly
2024-03-12 21:44:24 +01:00
7 changed files with 68 additions and 55 deletions

View File

@ -9,6 +9,7 @@
"fuzzywuzzy",
"gapless",
"instrumentalness",
"isrc",
"Mpris",
"RGBO",
"riverpod",

View File

@ -137,16 +137,16 @@
"pre_download_play_description": "Anzi che effettuare lo stream dell'audio, scarica invece i byte e li riproduce (raccomandato per gli utenti con banda più alta)",
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
"blacklist_description": "Tracce e artisti in blacklist",
"wait_for_download_to_finish": "Prego attendere che lo scaricamento corrente finisca",
"wait_for_download_to_finish": "Prego attendere che il download corrente finisca",
"desktop": "Desktop",
"close_behavior": "Comportamento Chiusura",
"close": "Chiudi",
"minimize_to_tray": "Minimizza in tray",
"show_tray_icon": "Mostra icona in tray di sistema",
"about": "A proposito di",
"about": "Informazioni su",
"u_love_spotube": "Sappiamo che ami Spotube",
"check_for_updates": "Controlla aggiornamenti",
"about_spotube": "A proposito di Spotube",
"about_spotube": "Informazioni su Spotube",
"blacklist": "Blacklist",
"please_sponsor": "Per favore sponsorizza/dona",
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
@ -187,7 +187,7 @@
"generate_playlist": "Genera Playlist",
"track_exists": "La traccia {track} esiste già",
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
"skip_download_tracks": "Salta lo scaricamento di tutte le tracce scaricate",
"skip_download_tracks": "Salta il download di tutte le tracce scaricate",
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
"replace": "Sovrascrivi",
"skip": "Salta",
@ -256,7 +256,7 @@
"querying_info": "Richiesta informazioni...",
"piped_api_down": "Le Piped API non funzionano",
"piped_down_error_instructions": "L'istanza di Piped {pipedInstance} è correntemente offline\n\nCambia istanza o cambia 'Tipo API' alle API ufficiali YouTube\n\nAssicurati di riavviare l'app dopo il cambio",
"you_are_offline": "Sei correntemente offline",
"you_are_offline": "Al momento sei offline",
"connection_restored": "Connessione ad internet ripristinata",
"use_system_title_bar": "Usa la barra del titolo di sistema",
"crunching_results": "Elaborazione risultati...",
@ -267,15 +267,15 @@
"change_cover": "Cambia copertina",
"add_cover": "Aggiungi copertina",
"restore_defaults": "Ripristina default",
"download_music_codec": "Codec musicale scaricamento",
"streaming_music_codec": "Codec musicale streaming",
"login_with_lastfm": "Accesso a Last.fm",
"connect": "Connetti",
"disconnect_lastfm": "Disconnetti Last.fm",
"download_music_codec": "Codec download musica",
"streaming_music_codec": "Codec streaming musica",
"login_with_lastfm": "Accedi con Last.fm",
"connect": "Connettiti",
"disconnect_lastfm": "Disconnettiti da Last.fm",
"disconnect": "Disconnetti",
"username": "Nome utente",
"password": "Password",
"login": "Accesso",
"login": "Accedi",
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
"scrobble_to_lastfm": "Invia a Last.fm",
"audio_source": "Fonte audio",
@ -299,7 +299,7 @@
"song_link": "Link della Canzone",
"skip_this_nonsense": "Salta questa sciocchezza",
"freedom_of_music": "“Libertà della Musica”",
"freedom_of_music_palm": "“Libertà della Musica nel palmo della tua mano”",
"freedom_of_music_palm": "“Libertà della Musica nelle tue mani”",
"get_started": "Cominciamo",
"youtube_source_description": "Consigliato e funziona meglio.",
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",

View File

@ -128,7 +128,10 @@ class ServerPlaybackRoutes {
.read(sourcedTrackProvider(SpotubeMedia(track)).notifier)
.refreshStreamingUrl();
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
if (playlist.activeTrack?.id == sourcedTrack?.id &&
sourcedTrack != null) {
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
}
return await dio.get<Uint8List>(
sourcedTrack!.url,
@ -199,7 +202,10 @@ class ServerPlaybackRoutes {
? activeSourcedTrack
: await ref.read(sourcedTrackProvider(SpotubeMedia(track)).future);
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
if (playlist.activeTrack?.id == sourcedTrack?.id &&
sourcedTrack != null) {
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
}
final (bytes: audioBytes, response: res) =
await streamTrack(sourcedTrack!, request.headers);

View File

@ -238,32 +238,28 @@ class YoutubeSourcedTrack extends SourcedTrack {
static Future<List<YoutubeVideoInfo>> fetchFromIsrc({
required Track track,
required Provider provider,
required Ref ref,
}) async {
final isrcResults = <YoutubeVideoInfo>[];
final isrc = track.externalIds?.isrc;
if (isrc != null && isrc.isNotEmpty) {
final searchedVideos = await ref
.read(provider)
.searchVideos(isrc.toString());
final searchedVideos =
await ref.read(youtubeEngineProvider).searchVideos(isrc.toString());
if (searchedVideos.isNotEmpty) {
isrcResults.addAll(searchedVideos
.map<YoutubeVideoInfo>(YoutubeVideoInfo.fromVideo)
.map((YoutubeVideoInfo videoInfo) {
final ytWords =
videoInfo.title
.toLowerCase()
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
.split(RegExp(r'\s+'))
.where((item) => item.isNotEmpty);
final spWords =
track.name!
.toLowerCase()
.replaceAll(RegExp(r'\((.*)\)'), '')
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
.split(RegExp(r'\s+'))
.where((item) => item.isNotEmpty);
final ytWords = videoInfo.title
.toLowerCase()
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
.split(RegExp(r'\s+'))
.where((item) => item.isNotEmpty);
final spWords = track.name!
.toLowerCase()
.replaceAll(RegExp(r'\((.*)\)'), '')
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
.split(RegExp(r'\s+'))
.where((item) => item.isNotEmpty);
// Word match to filter out unrelated results
final matchCount =
ytWords.where((word) => spWords.contains(word)).length;
@ -271,8 +267,9 @@ class YoutubeSourcedTrack extends SourcedTrack {
return videoInfo;
}
return null;
}
).whereType<YoutubeVideoInfo>().toList());
})
.whereType<YoutubeVideoInfo>()
.toList());
}
}
return isrcResults;
@ -284,22 +281,31 @@ class YoutubeSourcedTrack extends SourcedTrack {
}) async {
final videoResults = <YoutubeVideoInfo>[];
final isrcResults = await fetchFromIsrc(track: track, provider: youtubeEngineProvider, ref: ref);
videoResults.addAll(isrcResults);
if (track is! SourcedTrack) {
final isrcResults = await fetchFromIsrc(
track: track,
ref: ref,
);
final links = await SongLinkService.links(track.id!);
final ytLink = links.firstWhereOrNull((link) => link.platform == "youtube");
videoResults.addAll(isrcResults);
if (isrcResults.isEmpty && ytLink?.url != null) {
try {
videoResults.add(
YoutubeVideoInfo.fromVideo(
await ref.read(youtubeEngineProvider)
.getVideo(Uri.parse(ytLink!.url!).queryParameters["v"]!)
));
} on VideoUnplayableException catch (e, stack) {
// Ignore this error and continue with the search
AppLogger.reportError(e, stack);
if (isrcResults.isEmpty) {
final links = await SongLinkService.links(track.id!);
final ytLink = links.firstWhereOrNull(
(link) => link.platform == "youtube",
);
if (ytLink?.url != null) {
try {
videoResults.add(
YoutubeVideoInfo.fromVideo(await ref
.read(youtubeEngineProvider)
.getVideo(Uri.parse(ytLink!.url!).queryParameters["v"]!)),
);
} on VideoUnplayableException catch (e, stack) {
// Ignore this error and continue with the search
AppLogger.reportError(e, stack);
}
}
}
}
@ -309,13 +315,12 @@ class YoutubeSourcedTrack extends SourcedTrack {
await ref.read(youtubeEngineProvider).searchVideos(query);
if (ServiceUtils.onlyContainsEnglish(query)) {
videoResults.addAll(
searchResults.map(YoutubeVideoInfo.fromVideo).toList()
);
videoResults
.addAll(searchResults.map(YoutubeVideoInfo.fromVideo).toList());
} else {
videoResults.addAll(rankResults(
searchResults.map(YoutubeVideoInfo.fromVideo).toList(),
track,
searchResults.map(YoutubeVideoInfo.fromVideo).toList(),
track,
));
}

View File

@ -32,6 +32,7 @@ function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations)
endfunction()
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")

View File

@ -2449,10 +2449,10 @@ packages:
dependency: "direct main"
description:
name: tray_manager
sha256: f231031c5c0eb4ad514e18ddaab27a912ddbe50335c594bc28fb0f9972ab6a84
sha256: c2da0f0f1ddb455e721cf68d05d1281fec75cf5df0a1d3cb67b6ca0bdfd5709d
url: "https://pub.dev"
source: hosted
version: "0.3.1"
version: "0.4.0"
type_plus:
dependency: transitive
description:

View File

@ -120,7 +120,7 @@ dependencies:
test: ^1.25.7
timezone: ^0.10.0
titlebar_buttons: ^1.0.0
tray_manager: ^0.3.0
tray_manager: ^0.4.0
url_launcher: ^6.2.6
uuid: ^4.4.0
version: ^3.0.2