mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-08 08:17:31 +00:00
Compare commits
5 Commits
311af069d8
...
4b17c36aac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b17c36aac | ||
|
|
b74c2eab8f | ||
|
|
ff252d6b14 | ||
|
|
195cad8f39 | ||
|
|
19f525fa3c |
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -9,6 +9,7 @@
|
|||||||
"fuzzywuzzy",
|
"fuzzywuzzy",
|
||||||
"gapless",
|
"gapless",
|
||||||
"instrumentalness",
|
"instrumentalness",
|
||||||
|
"isrc",
|
||||||
"Mpris",
|
"Mpris",
|
||||||
"RGBO",
|
"RGBO",
|
||||||
"riverpod",
|
"riverpod",
|
||||||
|
|||||||
@ -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)",
|
"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)",
|
"skip_non_music": "Salta i segmenti non di musica (SponsorBlock)",
|
||||||
"blacklist_description": "Tracce e artisti in blacklist",
|
"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",
|
"desktop": "Desktop",
|
||||||
"close_behavior": "Comportamento Chiusura",
|
"close_behavior": "Comportamento Chiusura",
|
||||||
"close": "Chiudi",
|
"close": "Chiudi",
|
||||||
"minimize_to_tray": "Minimizza in tray",
|
"minimize_to_tray": "Minimizza in tray",
|
||||||
"show_tray_icon": "Mostra icona in tray di sistema",
|
"show_tray_icon": "Mostra icona in tray di sistema",
|
||||||
"about": "A proposito di",
|
"about": "Informazioni su",
|
||||||
"u_love_spotube": "Sappiamo che ami Spotube",
|
"u_love_spotube": "Sappiamo che ami Spotube",
|
||||||
"check_for_updates": "Controlla aggiornamenti",
|
"check_for_updates": "Controlla aggiornamenti",
|
||||||
"about_spotube": "A proposito di Spotube",
|
"about_spotube": "Informazioni su Spotube",
|
||||||
"blacklist": "Blacklist",
|
"blacklist": "Blacklist",
|
||||||
"please_sponsor": "Per favore sponsorizza/dona",
|
"please_sponsor": "Per favore sponsorizza/dona",
|
||||||
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
"spotube_description": "Spotube, un client spotify gratis per tutti, multipiattaforma e leggero",
|
||||||
@ -187,7 +187,7 @@
|
|||||||
"generate_playlist": "Genera Playlist",
|
"generate_playlist": "Genera Playlist",
|
||||||
"track_exists": "La traccia {track} esiste già",
|
"track_exists": "La traccia {track} esiste già",
|
||||||
"replace_downloaded_tracks": "Sostituisci tutte le tracce scaricate",
|
"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??",
|
"do_you_want_to_replace": "Vuoi sovrascrivere la traccia esistente??",
|
||||||
"replace": "Sovrascrivi",
|
"replace": "Sovrascrivi",
|
||||||
"skip": "Salta",
|
"skip": "Salta",
|
||||||
@ -256,7 +256,7 @@
|
|||||||
"querying_info": "Richiesta informazioni...",
|
"querying_info": "Richiesta informazioni...",
|
||||||
"piped_api_down": "Le Piped API non funzionano",
|
"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",
|
"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",
|
"connection_restored": "Connessione ad internet ripristinata",
|
||||||
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
"use_system_title_bar": "Usa la barra del titolo di sistema",
|
||||||
"crunching_results": "Elaborazione risultati...",
|
"crunching_results": "Elaborazione risultati...",
|
||||||
@ -267,15 +267,15 @@
|
|||||||
"change_cover": "Cambia copertina",
|
"change_cover": "Cambia copertina",
|
||||||
"add_cover": "Aggiungi copertina",
|
"add_cover": "Aggiungi copertina",
|
||||||
"restore_defaults": "Ripristina default",
|
"restore_defaults": "Ripristina default",
|
||||||
"download_music_codec": "Codec musicale scaricamento",
|
"download_music_codec": "Codec download musica",
|
||||||
"streaming_music_codec": "Codec musicale streaming",
|
"streaming_music_codec": "Codec streaming musica",
|
||||||
"login_with_lastfm": "Accesso a Last.fm",
|
"login_with_lastfm": "Accedi con Last.fm",
|
||||||
"connect": "Connetti",
|
"connect": "Connettiti",
|
||||||
"disconnect_lastfm": "Disconnetti Last.fm",
|
"disconnect_lastfm": "Disconnettiti da Last.fm",
|
||||||
"disconnect": "Disconnetti",
|
"disconnect": "Disconnetti",
|
||||||
"username": "Nome utente",
|
"username": "Nome utente",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"login": "Accesso",
|
"login": "Accedi",
|
||||||
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
"login_with_your_lastfm": "Accedi con il tuo account Last.fm",
|
||||||
"scrobble_to_lastfm": "Invia a Last.fm",
|
"scrobble_to_lastfm": "Invia a Last.fm",
|
||||||
"audio_source": "Fonte audio",
|
"audio_source": "Fonte audio",
|
||||||
@ -299,7 +299,7 @@
|
|||||||
"song_link": "Link della Canzone",
|
"song_link": "Link della Canzone",
|
||||||
"skip_this_nonsense": "Salta questa sciocchezza",
|
"skip_this_nonsense": "Salta questa sciocchezza",
|
||||||
"freedom_of_music": "“Libertà della Musica”",
|
"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",
|
"get_started": "Cominciamo",
|
||||||
"youtube_source_description": "Consigliato e funziona meglio.",
|
"youtube_source_description": "Consigliato e funziona meglio.",
|
||||||
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
"piped_source_description": "Ti senti libero? Come YouTube ma molto più gratuito.",
|
||||||
|
|||||||
@ -128,7 +128,10 @@ class ServerPlaybackRoutes {
|
|||||||
.read(sourcedTrackProvider(SpotubeMedia(track)).notifier)
|
.read(sourcedTrackProvider(SpotubeMedia(track)).notifier)
|
||||||
.refreshStreamingUrl();
|
.refreshStreamingUrl();
|
||||||
|
|
||||||
|
if (playlist.activeTrack?.id == sourcedTrack?.id &&
|
||||||
|
sourcedTrack != null) {
|
||||||
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
|
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
|
||||||
|
}
|
||||||
|
|
||||||
return await dio.get<Uint8List>(
|
return await dio.get<Uint8List>(
|
||||||
sourcedTrack!.url,
|
sourcedTrack!.url,
|
||||||
@ -199,7 +202,10 @@ class ServerPlaybackRoutes {
|
|||||||
? activeSourcedTrack
|
? activeSourcedTrack
|
||||||
: await ref.read(sourcedTrackProvider(SpotubeMedia(track)).future);
|
: await ref.read(sourcedTrackProvider(SpotubeMedia(track)).future);
|
||||||
|
|
||||||
|
if (playlist.activeTrack?.id == sourcedTrack?.id &&
|
||||||
|
sourcedTrack != null) {
|
||||||
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
|
ref.read(activeSourcedTrackProvider.notifier).update(sourcedTrack);
|
||||||
|
}
|
||||||
|
|
||||||
final (bytes: audioBytes, response: res) =
|
final (bytes: audioBytes, response: res) =
|
||||||
await streamTrack(sourcedTrack!, request.headers);
|
await streamTrack(sourcedTrack!, request.headers);
|
||||||
|
|||||||
@ -238,27 +238,23 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
|
|
||||||
static Future<List<YoutubeVideoInfo>> fetchFromIsrc({
|
static Future<List<YoutubeVideoInfo>> fetchFromIsrc({
|
||||||
required Track track,
|
required Track track,
|
||||||
required Provider provider,
|
|
||||||
required Ref ref,
|
required Ref ref,
|
||||||
}) async {
|
}) async {
|
||||||
final isrcResults = <YoutubeVideoInfo>[];
|
final isrcResults = <YoutubeVideoInfo>[];
|
||||||
final isrc = track.externalIds?.isrc;
|
final isrc = track.externalIds?.isrc;
|
||||||
if (isrc != null && isrc.isNotEmpty) {
|
if (isrc != null && isrc.isNotEmpty) {
|
||||||
final searchedVideos = await ref
|
final searchedVideos =
|
||||||
.read(provider)
|
await ref.read(youtubeEngineProvider).searchVideos(isrc.toString());
|
||||||
.searchVideos(isrc.toString());
|
|
||||||
if (searchedVideos.isNotEmpty) {
|
if (searchedVideos.isNotEmpty) {
|
||||||
isrcResults.addAll(searchedVideos
|
isrcResults.addAll(searchedVideos
|
||||||
.map<YoutubeVideoInfo>(YoutubeVideoInfo.fromVideo)
|
.map<YoutubeVideoInfo>(YoutubeVideoInfo.fromVideo)
|
||||||
.map((YoutubeVideoInfo videoInfo) {
|
.map((YoutubeVideoInfo videoInfo) {
|
||||||
final ytWords =
|
final ytWords = videoInfo.title
|
||||||
videoInfo.title
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
|
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
|
||||||
.split(RegExp(r'\s+'))
|
.split(RegExp(r'\s+'))
|
||||||
.where((item) => item.isNotEmpty);
|
.where((item) => item.isNotEmpty);
|
||||||
final spWords =
|
final spWords = track.name!
|
||||||
track.name!
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replaceAll(RegExp(r'\((.*)\)'), '')
|
.replaceAll(RegExp(r'\((.*)\)'), '')
|
||||||
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
|
.replaceAll(RegExp(r'[^a-zA-Z0-9\s]+'), '')
|
||||||
@ -271,8 +267,9 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
return videoInfo;
|
return videoInfo;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
})
|
||||||
).whereType<YoutubeVideoInfo>().toList());
|
.whereType<YoutubeVideoInfo>()
|
||||||
|
.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isrcResults;
|
return isrcResults;
|
||||||
@ -284,24 +281,33 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
}) async {
|
}) async {
|
||||||
final videoResults = <YoutubeVideoInfo>[];
|
final videoResults = <YoutubeVideoInfo>[];
|
||||||
|
|
||||||
final isrcResults = await fetchFromIsrc(track: track, provider: youtubeEngineProvider, ref: ref);
|
if (track is! SourcedTrack) {
|
||||||
|
final isrcResults = await fetchFromIsrc(
|
||||||
|
track: track,
|
||||||
|
ref: ref,
|
||||||
|
);
|
||||||
|
|
||||||
videoResults.addAll(isrcResults);
|
videoResults.addAll(isrcResults);
|
||||||
|
|
||||||
|
if (isrcResults.isEmpty) {
|
||||||
final links = await SongLinkService.links(track.id!);
|
final links = await SongLinkService.links(track.id!);
|
||||||
final ytLink = links.firstWhereOrNull((link) => link.platform == "youtube");
|
final ytLink = links.firstWhereOrNull(
|
||||||
|
(link) => link.platform == "youtube",
|
||||||
if (isrcResults.isEmpty && ytLink?.url != null) {
|
);
|
||||||
|
if (ytLink?.url != null) {
|
||||||
try {
|
try {
|
||||||
videoResults.add(
|
videoResults.add(
|
||||||
YoutubeVideoInfo.fromVideo(
|
YoutubeVideoInfo.fromVideo(await ref
|
||||||
await ref.read(youtubeEngineProvider)
|
.read(youtubeEngineProvider)
|
||||||
.getVideo(Uri.parse(ytLink!.url!).queryParameters["v"]!)
|
.getVideo(Uri.parse(ytLink!.url!).queryParameters["v"]!)),
|
||||||
));
|
);
|
||||||
} on VideoUnplayableException catch (e, stack) {
|
} on VideoUnplayableException catch (e, stack) {
|
||||||
// Ignore this error and continue with the search
|
// Ignore this error and continue with the search
|
||||||
AppLogger.reportError(e, stack);
|
AppLogger.reportError(e, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final query = SourcedTrack.getSearchTerm(track);
|
final query = SourcedTrack.getSearchTerm(track);
|
||||||
|
|
||||||
@ -309,9 +315,8 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
|||||||
await ref.read(youtubeEngineProvider).searchVideos(query);
|
await ref.read(youtubeEngineProvider).searchVideos(query);
|
||||||
|
|
||||||
if (ServiceUtils.onlyContainsEnglish(query)) {
|
if (ServiceUtils.onlyContainsEnglish(query)) {
|
||||||
videoResults.addAll(
|
videoResults
|
||||||
searchResults.map(YoutubeVideoInfo.fromVideo).toList()
|
.addAll(searchResults.map(YoutubeVideoInfo.fromVideo).toList());
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
videoResults.addAll(rankResults(
|
videoResults.addAll(rankResults(
|
||||||
searchResults.map(YoutubeVideoInfo.fromVideo).toList(),
|
searchResults.map(YoutubeVideoInfo.fromVideo).toList(),
|
||||||
|
|||||||
@ -32,6 +32,7 @@ function(APPLY_STANDARD_SETTINGS TARGET)
|
|||||||
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
||||||
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
||||||
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||||
|
target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||||
|
|||||||
@ -2449,10 +2449,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: tray_manager
|
name: tray_manager
|
||||||
sha256: f231031c5c0eb4ad514e18ddaab27a912ddbe50335c594bc28fb0f9972ab6a84
|
sha256: c2da0f0f1ddb455e721cf68d05d1281fec75cf5df0a1d3cb67b6ca0bdfd5709d
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.1"
|
version: "0.4.0"
|
||||||
type_plus:
|
type_plus:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -120,7 +120,7 @@ dependencies:
|
|||||||
test: ^1.25.7
|
test: ^1.25.7
|
||||||
timezone: ^0.10.0
|
timezone: ^0.10.0
|
||||||
titlebar_buttons: ^1.0.0
|
titlebar_buttons: ^1.0.0
|
||||||
tray_manager: ^0.3.0
|
tray_manager: ^0.4.0
|
||||||
url_launcher: ^6.2.6
|
url_launcher: ^6.2.6
|
||||||
uuid: ^4.4.0
|
uuid: ^4.4.0
|
||||||
version: ^3.0.2
|
version: ^3.0.2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user