mirror of
https://github.com/KRTirtho/spotube.git
synced 2026-03-23 08:54:15 +00:00
Compare commits
No commits in common. "25bafe17560d83dc1ed5a22ab5281ab7972df76f" and "7ad20666841238e7e77a15cf2dc67e5763d80ee8" have entirely different histories.
25bafe1756
...
7ad2066684
16
.github/workflows/spotube-release-binary.yml
vendored
16
.github/workflows/spotube-release-binary.yml
vendored
@ -78,14 +78,14 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
git-source: https://github.com/flutter/flutter.git
|
git-source: https://github.com/flutter/flutter.git
|
||||||
|
|
||||||
# - name: free disk space
|
- name: free disk space
|
||||||
# if: ${{ matrix.platform == 'android' }}
|
if: ${{ matrix.platform == 'android' }}
|
||||||
# run: |
|
run: |
|
||||||
# sudo swapoff -a
|
sudo swapoff -a
|
||||||
# sudo rm -f /swapfile
|
sudo rm -f /swapfile
|
||||||
# sudo apt clean
|
sudo apt clean
|
||||||
# docker rmi $(docker image ls -aq)
|
docker rmi $(docker image ls -aq)
|
||||||
# df -h
|
df -h
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
if: ${{matrix.platform == 'android'}}
|
if: ${{matrix.platform == 'android'}}
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
|
|||||||
1
android/app/proguard-rules.pro
vendored
1
android/app/proguard-rules.pro
vendored
@ -27,7 +27,6 @@
|
|||||||
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
|
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
|
||||||
-keep class org.mozilla.javascript.** { *; }
|
-keep class org.mozilla.javascript.** { *; }
|
||||||
-keep class org.mozilla.classfile.ClassFileWriter
|
-keep class org.mozilla.classfile.ClassFileWriter
|
||||||
-dontwarn com.google.re2j.**
|
|
||||||
-dontwarn org.mozilla.javascript.tools.**
|
-dontwarn org.mozilla.javascript.tools.**
|
||||||
|
|
||||||
-dontwarn javax.script.AbstractScriptEngine
|
-dontwarn javax.script.AbstractScriptEngine
|
||||||
|
|||||||
Binary file not shown.
@ -28,7 +28,7 @@ class HomeNewReleasesSection extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (newReleases.error
|
if (newReleases.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _,
|
message: _,
|
||||||
)) {
|
)) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class HomePageBrowseSection extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (browseSections.error
|
if (browseSections.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _,
|
message: _,
|
||||||
)) {
|
)) {
|
||||||
return const SliverFillRemaining(
|
return const SliverFillRemaining(
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class UserAlbumsPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (albumsQuery.error
|
if (albumsQuery.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _,
|
message: _,
|
||||||
)) {
|
)) {
|
||||||
return const Center(child: NoDefaultMetadataPlugin());
|
return const Center(child: NoDefaultMetadataPlugin());
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class UserArtistsPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (artistQuery.error
|
if (artistQuery.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _,
|
message: _,
|
||||||
)) {
|
)) {
|
||||||
return const Center(child: NoDefaultMetadataPlugin());
|
return const Center(child: NoDefaultMetadataPlugin());
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class UserPlaylistsPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (playlistsQuery.error
|
if (playlistsQuery.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _,
|
message: _,
|
||||||
)) {
|
)) {
|
||||||
return const Center(child: NoDefaultMetadataPlugin());
|
return const Center(child: NoDefaultMetadataPlugin());
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class SearchPage extends HookConsumerWidget {
|
|||||||
child: Builder(builder: (context) {
|
child: Builder(builder: (context) {
|
||||||
if (searchChipSnapshot.error
|
if (searchChipSnapshot.error
|
||||||
case MetadataPluginException(
|
case MetadataPluginException(
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
message: _
|
message: _
|
||||||
)) {
|
)) {
|
||||||
return const NoDefaultMetadataPlugin();
|
return const NoDefaultMetadataPlugin();
|
||||||
|
|||||||
@ -144,8 +144,40 @@ class AudioPlayerNotifier extends Notifier<AudioPlayerState> {
|
|||||||
}),
|
}),
|
||||||
audioPlayer.playlistStream.listen((playlist) async {
|
audioPlayer.playlistStream.listen((playlist) async {
|
||||||
try {
|
try {
|
||||||
final tracks =
|
// Playlist and state has to be in sync. This is only meant for
|
||||||
playlist.medias.map((e) => SpotubeMedia.media(e).track).toList();
|
// the shuffle/re-ordering indices to be in sync
|
||||||
|
if (playlist.medias.length != state.tracks.length) {
|
||||||
|
AppLogger.log.w(
|
||||||
|
"Playlist length does not match state tracks length. Ignoring... "
|
||||||
|
"Playlist length: ${playlist.medias.length}, "
|
||||||
|
"State tracks length: ${state.tracks.length}",
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final trackGroupedById = groupBy(
|
||||||
|
state.tracks,
|
||||||
|
(query) => query.id,
|
||||||
|
);
|
||||||
|
|
||||||
|
final tracks = <SpotubeTrackObject>[];
|
||||||
|
|
||||||
|
for (final media in playlist.medias) {
|
||||||
|
final track = trackGroupedById[SpotubeMedia.media(media).track.id]
|
||||||
|
?.firstOrNull;
|
||||||
|
if (track != null) {
|
||||||
|
tracks.add(track);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tracks.length != state.tracks.length) {
|
||||||
|
AppLogger.log.w("Mismatch in tracks after reordering/shuffling.");
|
||||||
|
final missingTracks =
|
||||||
|
state.tracks.where((track) => !tracks.contains(track)).toList();
|
||||||
|
AppLogger.log.w(
|
||||||
|
"Missing tracks: ${missingTracks.map((e) => e.id).join(", ")}",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
tracks: tracks,
|
tracks: tracks,
|
||||||
@ -402,31 +434,13 @@ class AudioPlayerNotifier extends Notifier<AudioPlayerState> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final oldState = state;
|
final currentIndex = state.currentIndex;
|
||||||
await audioPlayer.stop();
|
final currentTrack = state.activeTrack as SpotubeFullTrackObject;
|
||||||
|
final swappedMedia = SpotubeMedia(currentTrack);
|
||||||
|
|
||||||
await load(
|
await audioPlayer.addTrackAt(swappedMedia, currentIndex + 1);
|
||||||
oldState.tracks,
|
await audioPlayer.skipToNext();
|
||||||
initialIndex: oldState.currentIndex,
|
await audioPlayer.removeTrack(currentIndex);
|
||||||
autoPlay: true,
|
|
||||||
);
|
|
||||||
state = state.copyWith(
|
|
||||||
collections: oldState.collections,
|
|
||||||
loopMode: oldState.loopMode,
|
|
||||||
playing: oldState.playing,
|
|
||||||
shuffled: false,
|
|
||||||
);
|
|
||||||
await audioPlayer.setLoopMode(oldState.loopMode);
|
|
||||||
await _updatePlayerState(
|
|
||||||
AudioPlayerStateTableCompanion(
|
|
||||||
tracks: Value(state.tracks),
|
|
||||||
currentIndex: Value(state.currentIndex),
|
|
||||||
collections: Value(state.collections),
|
|
||||||
loopMode: Value(state.loopMode),
|
|
||||||
playing: Value(state.playing),
|
|
||||||
shuffled: Value(state.shuffled),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> jumpToTrack(SpotubeTrackObject track) async {
|
Future<void> jumpToTrack(SpotubeTrackObject track) async {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ final metadataPluginAlbumProvider =
|
|||||||
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataPlugin.album.getAlbum(id);
|
return metadataPlugin.album.getAlbum(id);
|
||||||
|
|||||||
@ -12,7 +12,7 @@ final metadataPluginArtistProvider =
|
|||||||
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataPlugin.artist.getArtist(artistId);
|
return metadataPlugin.artist.getArtist(artistId);
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
import 'package:spotube/models/metadata/metadata.dart';
|
import 'package:spotube/models/metadata/metadata.dart';
|
||||||
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
||||||
import 'package:spotube/services/audio_player/audio_player.dart';
|
import 'package:spotube/services/audio_player/audio_player.dart';
|
||||||
import 'package:spotube/services/metadata/errors/exceptions.dart';
|
|
||||||
import 'package:spotube/services/metadata/metadata.dart';
|
import 'package:spotube/services/metadata/metadata.dart';
|
||||||
|
|
||||||
part 'quality_presets.g.dart';
|
part 'quality_presets.g.dart';
|
||||||
@ -62,7 +61,7 @@ class AudioSourceAvailableQualityPresetsNotifier
|
|||||||
audioSourceConfigSnapshot.whenData((audioSourceConfig) {
|
audioSourceConfigSnapshot.whenData((audioSourceConfig) {
|
||||||
audioSourceSnapshot.whenData((audioSource) async {
|
audioSourceSnapshot.whenData((audioSource) async {
|
||||||
if (audioSource == null || audioSourceConfig == null) {
|
if (audioSource == null || audioSourceConfig == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
final preferences = await SharedPreferences.getInstance();
|
final preferences = await SharedPreferences.getInstance();
|
||||||
final persistedStateStr =
|
final persistedStateStr =
|
||||||
@ -115,7 +114,7 @@ class AudioSourceAvailableQualityPresetsNotifier
|
|||||||
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
||||||
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
||||||
if (audioSourceConfig == null) {
|
if (audioSourceConfig == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
|
|
||||||
final preferences = await SharedPreferences.getInstance();
|
final preferences = await SharedPreferences.getInstance();
|
||||||
|
|||||||
@ -131,7 +131,7 @@ final metadataPluginIsSavedPlaylistProvider =
|
|||||||
final plugin = await ref.watch(metadataPluginProvider.future);
|
final plugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
final savedPlaylists =
|
final savedPlaylists =
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class MetadataPluginPlaylistNotifier
|
|||||||
final metadataPlugin = await ref.read(metadataPluginProvider.future);
|
final metadataPlugin = await ref.read(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataPlugin;
|
return metadataPlugin;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ final metadataPluginSearchAllProvider =
|
|||||||
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataPlugin.search.all(query);
|
return metadataPlugin.search.all(query);
|
||||||
@ -20,7 +20,7 @@ final metadataPluginSearchChipsProvider = FutureProvider((ref) async {
|
|||||||
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
return metadataPlugin.search.chips;
|
return metadataPlugin.search.chips;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,7 +8,7 @@ final metadataPluginTrackProvider =
|
|||||||
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
final metadataPlugin = await ref.watch(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataPlugin.track.getTrack(trackId);
|
return metadataPlugin.track.getTrack(trackId);
|
||||||
|
|||||||
@ -20,7 +20,7 @@ mixin MetadataPluginMixin<K>
|
|||||||
final plugin = await ref.read(metadataPluginProvider.future);
|
final plugin = await ref.read(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugin;
|
return plugin;
|
||||||
|
|||||||
@ -95,7 +95,7 @@ class TrackOptionsActions {
|
|||||||
final metadataPlugin = await ref.read(metadataPluginProvider.future);
|
final metadataPlugin = await ref.read(metadataPluginProvider.future);
|
||||||
|
|
||||||
if (metadataPlugin == null) {
|
if (metadataPlugin == null) {
|
||||||
throw MetadataPluginException.noDefaultMetadataPlugin();
|
throw MetadataPluginException.noDefaultPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
final tracks = await metadataPlugin.track.radio(track.id);
|
final tracks = await metadataPlugin.track.radio(track.id);
|
||||||
|
|||||||
@ -9,8 +9,7 @@ enum MetadataPluginErrorCode {
|
|||||||
pluginDownloadFailed,
|
pluginDownloadFailed,
|
||||||
duplicatePlugin,
|
duplicatePlugin,
|
||||||
pluginByteCodeFileNotFound,
|
pluginByteCodeFileNotFound,
|
||||||
noDefaultMetadataPlugin,
|
noDefaultPlugin,
|
||||||
noDefaultAudiSourcePlugin,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MetadataPluginException implements Exception {
|
class MetadataPluginException implements Exception {
|
||||||
@ -69,15 +68,10 @@ class MetadataPluginException implements Exception {
|
|||||||
'Plugin byte code file, plugin.out not found. Please ensure the plugin is correctly packaged.',
|
'Plugin byte code file, plugin.out not found. Please ensure the plugin is correctly packaged.',
|
||||||
errorCode: MetadataPluginErrorCode.pluginByteCodeFileNotFound,
|
errorCode: MetadataPluginErrorCode.pluginByteCodeFileNotFound,
|
||||||
);
|
);
|
||||||
MetadataPluginException.noDefaultMetadataPlugin()
|
MetadataPluginException.noDefaultPlugin()
|
||||||
: this._(
|
: this._(
|
||||||
'No default metadata plugin is set. Please set a default plugin in the settings.',
|
'No default metadata plugin is set. Please set a default plugin in the settings.',
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultMetadataPlugin,
|
errorCode: MetadataPluginErrorCode.noDefaultPlugin,
|
||||||
);
|
|
||||||
MetadataPluginException.noDefaultAudioSourcePlugin()
|
|
||||||
: this._(
|
|
||||||
'No default audio source plugin is set. Please set a default plugin in the settings.',
|
|
||||||
errorCode: MetadataPluginErrorCode.noDefaultAudiSourcePlugin,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import 'package:spotube/provider/metadata_plugin/audio_source/quality_presets.da
|
|||||||
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
import 'package:spotube/provider/metadata_plugin/metadata_plugin_provider.dart';
|
||||||
import 'package:spotube/services/dio/dio.dart';
|
import 'package:spotube/services/dio/dio.dart';
|
||||||
import 'package:spotube/services/logger/logger.dart';
|
import 'package:spotube/services/logger/logger.dart';
|
||||||
import 'package:spotube/services/metadata/errors/exceptions.dart';
|
|
||||||
|
|
||||||
import 'package:spotube/services/sourced_track/exceptions.dart';
|
import 'package:spotube/services/sourced_track/exceptions.dart';
|
||||||
import 'package:spotube/utils/service_utils.dart';
|
import 'package:spotube/utils/service_utils.dart';
|
||||||
@ -42,7 +41,7 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
||||||
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
||||||
if (audioSource == null || audioSourceConfig == null) {
|
if (audioSource == null || audioSourceConfig == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
|
|
||||||
final database = ref.read(databaseProvider);
|
final database = ref.read(databaseProvider);
|
||||||
@ -158,7 +157,7 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
final audioSource = await ref.read(audioSourcePluginProvider.future);
|
final audioSource = await ref.read(audioSourcePluginProvider.future);
|
||||||
|
|
||||||
if (audioSource == null) {
|
if (audioSource == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
|
|
||||||
final videoResults = <SpotubeAudioSourceMatchObject>[];
|
final videoResults = <SpotubeAudioSourceMatchObject>[];
|
||||||
@ -191,8 +190,7 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<SourcedTrack?> swapWithSibling(
|
Future<SourcedTrack?> swapWithSibling(
|
||||||
SpotubeAudioSourceMatchObject sibling,
|
SpotubeAudioSourceMatchObject sibling) async {
|
||||||
) async {
|
|
||||||
if (sibling.id == info.id) {
|
if (sibling.id == info.id) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -201,7 +199,7 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
||||||
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
||||||
if (audioSource == null || audioSourceConfig == null) {
|
if (audioSource == null || audioSourceConfig == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
|
|
||||||
// a sibling source that was fetched from the search results
|
// a sibling source that was fetched from the search results
|
||||||
@ -218,19 +216,10 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
|
|
||||||
final database = ref.read(databaseProvider);
|
final database = ref.read(databaseProvider);
|
||||||
|
|
||||||
// Delete the old Entry
|
|
||||||
await (database.sourceMatchTable.delete()
|
|
||||||
..where(
|
|
||||||
(table) =>
|
|
||||||
table.trackId.equals(query.id) &
|
|
||||||
table.sourceType.equals(audioSourceConfig.slug),
|
|
||||||
))
|
|
||||||
.go();
|
|
||||||
|
|
||||||
await database.into(database.sourceMatchTable).insert(
|
await database.into(database.sourceMatchTable).insert(
|
||||||
SourceMatchTableCompanion.insert(
|
SourceMatchTableCompanion.insert(
|
||||||
trackId: query.id,
|
trackId: query.id,
|
||||||
sourceInfo: Value(jsonEncode(sibling)),
|
sourceInfo: Value(jsonEncode(siblings.first)),
|
||||||
sourceType: audioSourceConfig.slug,
|
sourceType: audioSourceConfig.slug,
|
||||||
createdAt: Value(DateTime.now()),
|
createdAt: Value(DateTime.now()),
|
||||||
),
|
),
|
||||||
@ -256,7 +245,7 @@ class SourcedTrack extends BasicSourcedTrack {
|
|||||||
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
final audioSourceConfig = await ref.read(metadataPluginsProvider
|
||||||
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
.selectAsync((data) => data.defaultAudioSourcePluginConfig));
|
||||||
if (audioSource == null || audioSourceConfig == null) {
|
if (audioSource == null || audioSourceConfig == null) {
|
||||||
throw MetadataPluginException.noDefaultAudioSourcePlugin();
|
throw Exception("Dude wat?");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SpotubeAudioSourceStreamObject> validStreams = [];
|
List<SpotubeAudioSourceStreamObject> validStreams = [];
|
||||||
|
|||||||
18
pubspec.lock
18
pubspec.lock
@ -745,11 +745,11 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: HEAD
|
ref: master
|
||||||
resolved-ref: "458046cd9a88924e5074d96ba45397219d53b230"
|
resolved-ref: "922f9f9eafd8b501da83dca67d56b2887fa8f916"
|
||||||
url: "https://github.com/maeltoukap/fk_user_agent.git"
|
url: "https://github.com/TiffApps/fk_user_agent.git"
|
||||||
source: git
|
source: git
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
fluentui_system_icons:
|
fluentui_system_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -947,8 +947,8 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: HEAD
|
ref: HEAD
|
||||||
resolved-ref: ab3ff415114b7b43593e6ee718ad3d760af18350
|
resolved-ref: "898fd4ebcef77f5177b08aa6f9b9047bd02c6b9b"
|
||||||
url: "https://github.com/KRTirtho/flutter_new_pipe_extractor"
|
url: "https://github.com/KRTirtho/flutter_new_pipe_extractor.git"
|
||||||
source: git
|
source: git
|
||||||
version: "0.1.0"
|
version: "0.1.0"
|
||||||
flutter_plugin_android_lifecycle:
|
flutter_plugin_android_lifecycle:
|
||||||
@ -1189,7 +1189,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: main
|
ref: main
|
||||||
resolved-ref: d85dd429241d464a8b5b0c2b3d870143eeba8b46
|
resolved-ref: "32828156bc111d147709f8d644804227bbdfe8f1"
|
||||||
url: "https://github.com/KRTirtho/hetu_spotube_plugin.git"
|
url: "https://github.com/KRTirtho/hetu_spotube_plugin.git"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.2"
|
version: "0.0.2"
|
||||||
@ -2728,10 +2728,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: youtube_explode_dart
|
name: youtube_explode_dart
|
||||||
sha256: "3d731d71df9901b1915bae806781df519cff32517e36db279f844ae619669e45"
|
sha256: add33de45d80c7f71a5e3dd464dd82fafd7fb5ab875fd303c023f30f76618325
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.5"
|
version: "3.0.0"
|
||||||
yt_dlp_dart:
|
yt_dlp_dart:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -114,14 +114,14 @@ dependencies:
|
|||||||
wikipedia_api: ^0.1.0
|
wikipedia_api: ^0.1.0
|
||||||
win32_registry: ^1.1.5
|
win32_registry: ^1.1.5
|
||||||
window_manager: ^0.4.3
|
window_manager: ^0.4.3
|
||||||
youtube_explode_dart: ^3.0.5
|
youtube_explode_dart: ^3.0.0
|
||||||
yt_dlp_dart:
|
yt_dlp_dart:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/KRTirtho/yt_dlp_dart.git
|
url: https://github.com/KRTirtho/yt_dlp_dart.git
|
||||||
ref: 4e5310e14af74bdbb51e2a4766e66d6c6a2562a8
|
ref: 4e5310e14af74bdbb51e2a4766e66d6c6a2562a8
|
||||||
flutter_new_pipe_extractor:
|
flutter_new_pipe_extractor:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/KRTirtho/flutter_new_pipe_extractor
|
url: https://github.com/KRTirtho/flutter_new_pipe_extractor.git
|
||||||
http_parser: ^4.1.2
|
http_parser: ^4.1.2
|
||||||
collection: any
|
collection: any
|
||||||
archive: ^4.0.7
|
archive: ^4.0.7
|
||||||
@ -239,8 +239,6 @@ flutter:
|
|||||||
- packages/hetu_std/assets/bytecode/std.out
|
- packages/hetu_std/assets/bytecode/std.out
|
||||||
- packages/hetu_otp_util/assets/bytecode/otp_util.out
|
- packages/hetu_otp_util/assets/bytecode/otp_util.out
|
||||||
- packages/hetu_spotube_plugin/assets/bytecode/spotube_plugin.out
|
- packages/hetu_spotube_plugin/assets/bytecode/spotube_plugin.out
|
||||||
# NewPipe binaries (desktop only)
|
|
||||||
# - packages/flutter_new_pipe_extractor/assets/
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: RadixIcons
|
- family: RadixIcons
|
||||||
fonts:
|
fonts:
|
||||||
|
|||||||
@ -22,8 +22,6 @@ export const routes: Record<string, [string, IconType | null]> = {
|
|||||||
|
|
||||||
const releasesUrl =
|
const releasesUrl =
|
||||||
"https://github.com/KRTirtho/Spotube/releases/latest/download";
|
"https://github.com/KRTirtho/Spotube/releases/latest/download";
|
||||||
const releasesNightlyUrl =
|
|
||||||
"https://github.com/KRTirtho/Spotube/releases/download/nightly";
|
|
||||||
|
|
||||||
export const downloadLinks: Record<string, [string, IconType[]]> = {
|
export const downloadLinks: Record<string, [string, IconType[]]> = {
|
||||||
"Android Apk": [`${releasesUrl}/Spotube-android-all-arch.apk`, [FaAndroid]],
|
"Android Apk": [`${releasesUrl}/Spotube-android-all-arch.apk`, [FaAndroid]],
|
||||||
@ -89,47 +87,39 @@ export const extendedNightlyDownloadLinks: Record<
|
|||||||
string,
|
string,
|
||||||
[string, IconType[], string]
|
[string, IconType[], string]
|
||||||
> = {
|
> = {
|
||||||
Android: [
|
Android: [`${releasesUrl}/Spotube-android-all-arch.apk`, [FaAndroid], "apk"],
|
||||||
`${releasesNightlyUrl}/Spotube-android-all-arch.apk`,
|
|
||||||
[FaAndroid],
|
|
||||||
"apk",
|
|
||||||
],
|
|
||||||
Windows: [
|
Windows: [
|
||||||
`${releasesNightlyUrl}/Spotube-windows-x86_64-setup.exe`,
|
`${releasesUrl}/Spotube-windows-x86_64-setup.exe`,
|
||||||
[FaWindows],
|
[FaWindows],
|
||||||
"exe",
|
"exe",
|
||||||
],
|
],
|
||||||
macOS: [
|
macOS: [`${releasesUrl}/Spotube-macos-universal.dmg`, [FaApple], "dmg"],
|
||||||
`${releasesNightlyUrl}/Spotube-macos-universal.dmg`,
|
|
||||||
[FaApple],
|
|
||||||
"dmg",
|
|
||||||
],
|
|
||||||
"Ubuntu, Debian (x64)": [
|
"Ubuntu, Debian (x64)": [
|
||||||
`${releasesNightlyUrl}/Spotube-linux-x86_64.deb`,
|
`${releasesUrl}/Spotube-linux-x86_64.deb`,
|
||||||
[FaUbuntu, FaDebian],
|
[FaUbuntu, FaDebian],
|
||||||
"deb",
|
"deb",
|
||||||
],
|
],
|
||||||
"Ubuntu, Debian (arm64)": [
|
"Ubuntu, Debian (arm64)": [
|
||||||
`${releasesNightlyUrl}/Spotube-linux-aarch64.deb`,
|
`${releasesUrl}/Spotube-linux-aarch64.deb`,
|
||||||
[FaUbuntu, FaDebian],
|
[FaUbuntu, FaDebian],
|
||||||
"deb",
|
"deb",
|
||||||
],
|
],
|
||||||
"Fedora, Redhat, Opensuse": [
|
"Fedora, Redhat, Opensuse": [
|
||||||
`${releasesNightlyUrl}/Spotube-linux-x86_64.rpm`,
|
`${releasesUrl}/Spotube-linux-x86_64.rpm`,
|
||||||
[FaFedora, FaRedhat, FaOpensuse],
|
[FaFedora, FaRedhat, FaOpensuse],
|
||||||
"rpm",
|
"rpm",
|
||||||
],
|
],
|
||||||
"Linux AppImage (x64)": [
|
"Linux AppImage (x64)": [
|
||||||
`${releasesNightlyUrl}/Spotube-linux-x86_64.AppImage`,
|
`${releasesUrl}/Spotube-linux-x86_64.AppImage`,
|
||||||
[FaLinux],
|
[FaLinux],
|
||||||
"AppImage",
|
"AppImage",
|
||||||
],
|
],
|
||||||
"Linux AppImage (arm64)": [
|
"Linux AppImage (arm64)": [
|
||||||
`${releasesNightlyUrl}/Spotube-linux-aarch64.AppImage`,
|
`${releasesUrl}/Spotube-linux-aarch64.AppImage`,
|
||||||
[FaLinux],
|
[FaLinux],
|
||||||
"AppImage",
|
"AppImage",
|
||||||
],
|
],
|
||||||
iPhone: [`${releasesNightlyUrl}/Spotube-iOS.ipa`, [FaApple], "ipa"],
|
iPhone: [`${releasesUrl}/Spotube-iOS.ipa`, [FaApple], "ipa"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ADS_SLOTS = Object.freeze({
|
export const ADS_SLOTS = Object.freeze({
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in New Issue
Block a user