fix(local-track): throwing exception when downloadLocation is empty

chore: bumped `audioplayers` to a git ref
This commit is contained in:
Kingkor Roy Tirtho 2022-09-13 10:13:54 +06:00
parent 74d56792c6
commit 1a3556d39e
3 changed files with 19 additions and 88 deletions

View File

@ -35,9 +35,11 @@ const imgMimeToExt = {
final localTracksProvider = FutureProvider<List<Track>>((ref) async { final localTracksProvider = FutureProvider<List<Track>>((ref) async {
try { try {
final downloadDir = Directory( final downloadLocation = ref.watch(
ref.watch(userPreferencesProvider.select((s) => s.downloadLocation)), userPreferencesProvider.select((s) => s.downloadLocation),
); );
if (downloadLocation.isEmpty) return [];
final downloadDir = Directory(downloadLocation);
if (!await downloadDir.exists()) { if (!await downloadDir.exists()) {
await downloadDir.create(recursive: true); await downloadDir.create(recursive: true);
return []; return [];

View File

@ -15,13 +15,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.1.0"
ansicolor:
dependency: transitive
description:
name: ansicolor
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
app_package_maker: app_package_maker:
dependency: transitive dependency: transitive
description: description:
@ -130,9 +123,11 @@ packages:
audioplayers: audioplayers:
dependency: "direct main" dependency: "direct main"
description: description:
name: audioplayers path: "packages/audioplayers"
url: "https://pub.dartlang.org" ref: "3ee12cd0361c0fc2f3d0303c504732d12fa8e49a"
source: hosted resolved-ref: "3ee12cd0361c0fc2f3d0303c504732d12fa8e49a"
url: "https://github.com/bluefireteam/audioplayers.git"
source: git
version: "1.0.1" version: "1.0.1"
audioplayers_android: audioplayers_android:
dependency: transitive dependency: transitive
@ -196,7 +191,7 @@ packages:
name: bitsdojo_window name: bitsdojo_window
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.5"
bitsdojo_window_linux: bitsdojo_window_linux:
dependency: transitive dependency: transitive
description: description:
@ -224,7 +219,7 @@ packages:
name: bitsdojo_window_windows name: bitsdojo_window_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.5"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -734,13 +729,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
msix:
dependency: "direct dev"
description:
name: msix
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.18"
oauth2: oauth2:
dependency: transitive dependency: transitive
description: description:
@ -824,7 +812,7 @@ packages:
name: path_provider name: path_provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.10" version: "2.0.11"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:

View File

@ -1,37 +1,16 @@
name: spotube name: spotube
description: A lightweight free Spotify crossplatform-client which handles playback manually, streams music using Youtube & no Spotify premium account is needed description: A lightweight free Spotify crossplatform-client which handles playback manually, streams music using Youtube & no Spotify premium account is needed
# The following line prevents the package from being accidentally published to publish_to: "none"
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.4.0+13 version: 2.4.0+13
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.17.0 <3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
cached_network_image: ^3.2.0 cached_network_image: ^3.2.0
html: ^0.15.0 html: ^0.15.0
@ -40,7 +19,7 @@ dependencies:
spotify: ^0.8.0 spotify: ^0.8.0
url_launcher: ^6.0.17 url_launcher: ^6.0.17
youtube_explode_dart: ^1.10.8 youtube_explode_dart: ^1.10.8
bitsdojo_window: 0.1.4 bitsdojo_window: ^0.1.5
path: ^1.8.0 path: ^1.8.0
path_provider: ^2.0.8 path_provider: ^2.0.8
collection: ^1.15.0 collection: ^1.15.0
@ -61,7 +40,11 @@ dependencies:
hive: ^2.2.2 hive: ^2.2.2
hive_flutter: ^1.1.0 hive_flutter: ^1.1.0
dbus: ^0.7.3 dbus: ^0.7.3
audioplayers: ^1.0.1 audioplayers:
git:
url: https://github.com/bluefireteam/audioplayers.git
ref: 3ee12cd0361c0fc2f3d0303c504732d12fa8e49a
path: packages/audioplayers/
introduction_screen: ^3.0.2 introduction_screen: ^3.0.2
audio_session: ^0.1.9 audio_session: ^0.1.9
# This is temporary until the win32v3 update PR is merged and released # This is temporary until the win32v3 update PR is merged and released
@ -85,60 +68,18 @@ dependency_overrides:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
msix: ^2.8.0
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.0 flutter_lints: ^1.0.0
flutter_launcher_icons: ^0.9.2 flutter_launcher_icons: ^0.9.2
hive_generator: ^1.1.3 hive_generator: ^1.1.3
build_runner: ^2.1.11 build_runner: ^2.1.11
flutter_distributor: ^0.0.2 flutter_distributor: ^0.0.2
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter: flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets: assets:
- assets/ - assets/
- assets/tutorial/ - assets/tutorial/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
flutter_icons: flutter_icons:
android: true android: true
image_path: "assets/spotube-logo.png" image_path: "assets/spotube-logo.png"