Skip to content

Commit

Permalink
fix(local-track): throwing exception when downloadLocation is empty
Browse files Browse the repository at this point in the history
chore: bumped `audioplayers` to a git ref
  • Loading branch information
KRTirtho committed Sep 13, 2022
1 parent 74d5679 commit 1a3556d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 88 deletions.
6 changes: 4 additions & 2 deletions lib/components/Library/UserLocalTracks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ const imgMimeToExt = {

final localTracksProvider = FutureProvider<List<Track>>((ref) async {
try {
final downloadDir = Directory(
ref.watch(userPreferencesProvider.select((s) => s.downloadLocation)),
final downloadLocation = ref.watch(
userPreferencesProvider.select((s) => s.downloadLocation),
);
if (downloadLocation.isEmpty) return [];
final downloadDir = Directory(downloadLocation);
if (!await downloadDir.exists()) {
await downloadDir.create(recursive: true);
return [];
Expand Down
28 changes: 8 additions & 20 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
ansicolor:
dependency: transitive
description:
name: ansicolor
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
app_package_maker:
dependency: transitive
description:
Expand Down Expand Up @@ -130,9 +123,11 @@ packages:
audioplayers:
dependency: "direct main"
description:
name: audioplayers
url: "https://pub.dartlang.org"
source: hosted
path: "packages/audioplayers"
ref: "3ee12cd0361c0fc2f3d0303c504732d12fa8e49a"
resolved-ref: "3ee12cd0361c0fc2f3d0303c504732d12fa8e49a"
url: "https://github.com/bluefireteam/audioplayers.git"
source: git
version: "1.0.1"
audioplayers_android:
dependency: transitive
Expand Down Expand Up @@ -196,7 +191,7 @@ packages:
name: bitsdojo_window
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
bitsdojo_window_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -224,7 +219,7 @@ packages:
name: bitsdojo_window_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -734,13 +729,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
msix:
dependency: "direct dev"
description:
name: msix
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.18"
oauth2:
dependency: transitive
description:
Expand Down Expand Up @@ -824,7 +812,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
version: "2.0.11"
path_provider_android:
dependency: transitive
description:
Expand Down
73 changes: 7 additions & 66 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
name: spotube
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
# 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
publish_to: "none"

# 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

environment:
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:
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
cached_network_image: ^3.2.0
html: ^0.15.0
Expand All @@ -40,7 +19,7 @@ dependencies:
spotify: ^0.8.0
url_launcher: ^6.0.17
youtube_explode_dart: ^1.10.8
bitsdojo_window: 0.1.4
bitsdojo_window: ^0.1.5
path: ^1.8.0
path_provider: ^2.0.8
collection: ^1.15.0
Expand All @@ -61,7 +40,11 @@ dependencies:
hive: ^2.2.2
hive_flutter: ^1.1.0
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
audio_session: ^0.1.9
# This is temporary until the win32v3 update PR is merged and released
Expand All @@ -85,60 +68,18 @@ dependency_overrides:
dev_dependencies:
flutter_test:
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_launcher_icons: ^0.9.2
hive_generator: ^1.1.3
build_runner: ^2.1.11
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:
# 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

# To add assets to your application, add an assets section, like this:
assets:
- assets/
- 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:
android: true
image_path: "assets/spotube-logo.png"
Expand Down

0 comments on commit 1a3556d

Please sign in to comment.