Skip to content

Commit 52cac59

Browse files
authored
Merge pull request #20 from C0ntrolDev/dev-1.1
Ver 1.1.3
2 parents 7925640 + fdee630 commit 52cac59

File tree

9 files changed

+47
-32
lines changed

9 files changed

+47
-32
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ App that allows you to download your favorite playlists at the touch of just one
3131
### Android
3232

3333
You can download this apk if you don't know what kind of architecture you have.
34-
- [spotify_downloader.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.2/spotify_downloader.apk)
34+
- [spotify_downloader.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.3/spotify_downloader.apk)
3535

3636
If you know what architecture you have, then download one of the apk listed below.
37-
- [spotify_downloader_armeabi-v7a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.2/spotify_downloader_armeabi-v7a.apk)
38-
- [spotify_downloader_arm64-v8a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.2/spotify_downloader_arm64-v8a.apk)
39-
- [spotify_downloader_x86_64.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.2/spotify_downloader_x86_64.apk)
37+
- [spotify_downloader_armeabi-v7a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.3/spotify_downloader_armeabi-v7a.apk)
38+
- [spotify_downloader_arm64-v8a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.3/spotify_downloader_arm64-v8a.apk)
39+
- [spotify_downloader_x86_64.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.3/spotify_downloader_x86_64.apk)
4040

4141
### IOS
4242

4343
You can download ipa there.
44-
- [spotify_downloader.ipa](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.2/spotify_downloader.ipa)
44+
- [spotify_downloader.ipa](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.3/spotify_downloader.ipa)
4545

4646
## How to use
4747

lib/core/utils/failures/custom_failures.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ final class AuthFailure extends NoDetailedFailure {
2626
AuthFailure({super.message = 'auth failure', super.stackTrace});
2727
}
2828

29+
final class AuthExitFailure extends NoDetailedFailure {
30+
AuthExitFailure({super.message = 'auth exit failure', super.stackTrace});
31+
}
32+
33+
2934
final class InvalidClientCredentialsFailure extends NoDetailedFailure {
3035
InvalidClientCredentialsFailure({super.message = 'invalid auth credentials failure', super.stackTrace});
3136
}

lib/features/data_domain/auth/network_auth/data/data_source/network_auth_data_source.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class NetworkAuthDataSource {
1919
AuthFailure(message: '${accessTokenResponse.error} : ${accessTokenResponse.errorDescription}'));
2020
}
2121

22+
if(accessTokenResponse.httpStatusCode == 404) {
23+
return Result.notSuccessful(AuthExitFailure());
24+
}
25+
2226
if (accessTokenResponse.accessToken == null ||
2327
accessTokenResponse.refreshToken == null ||
2428
accessTokenResponse.expirationDate == null) {

lib/features/data_domain/tracks/download_tracks/data/data_sources/dowload_audio_from_youtube_data_source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class DownloadAudioFromYoutubeDataSource {
194194
video = await yt.videos.get(VideoId.parseVideoId(args.youtubeUrl));
195195
if (token.isCancelled) return const CancellableResult.isCancelled();
196196

197-
final manifest = await yt.videos.streamsClient.getManifest(video.id);
197+
final manifest = await yt.videos.streams.getManifest(video.id, ytClients: [YoutubeApiClient.android, YoutubeApiClient.ios]);
198198
if (token.isCancelled) return const CancellableResult.isCancelled();
199199

200200
downloadStreamInfo = manifest.audioOnly.withHighestBitrate();

lib/features/presentation/settings/widgets/auth_settings/blocs/account_auth/account_auth_bloc.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ class AccountAuthBloc extends Bloc<AccountAuthEvent, AccountAuthState> {
5959
}
6060

6161
AccountAuthState _getFailureState(Failure? failure) {
62-
if (failure is NotAuthorizedFailure) {
62+
if (failure is NotAuthorizedFailure || failure is AuthExitFailure) {
6363
return AccountAuthNotAuthorized();
6464
}
65+
6566
if (failure is InvalidClientCredentialsFailure || failure is InvalidAccountCredentialsFailure) {
6667
return AccountAuthInvalidCredentialsFailure(failure: failure);
6768
}
69+
6870
if (failure is NetworkFailure) {
6971
return AccountAuthNetworkFailure();
7072
}

lib/features/presentation/settings/widgets/auth_settings/blocs/account_auth/account_auth_state.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ final class AccountAuthNotAuthorized extends AccountAuthState {}
2222

2323
final class AccountAuthNetworkFailure extends AccountAuthState {}
2424

25-
final class AccountAuthInvalidCredentialsFailure extends AccountAuthState {
26-
final Failure? failure;
27-
28-
const AccountAuthInvalidCredentialsFailure({required this.failure});
29-
}
30-
3125
final class AccountAuthFailure extends AccountAuthState {
3226
final Failure? failure;
3327

@@ -36,3 +30,7 @@ final class AccountAuthFailure extends AccountAuthState {
3630
@override
3731
List<Object?> get props => [failure];
3832
}
33+
34+
final class AccountAuthInvalidCredentialsFailure extends AccountAuthFailure {
35+
const AccountAuthInvalidCredentialsFailure({required super.failure});
36+
}

lib/features/presentation/settings/widgets/auth_settings/view/auth_settings.dart

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'package:spotify_downloader/core/app/colors/colors.dart';
44
import 'package:spotify_downloader/core/di/injector.dart';
5-
import 'package:spotify_downloader/core/utils/failures/failures.dart';
65
import 'package:spotify_downloader/features/presentation/settings/widgets/auth_settings/blocs/account_auth/account_auth_bloc.dart';
76
import 'package:spotify_downloader/features/presentation/settings/widgets/auth_settings/blocs/client_auth/client_auth_bloc.dart';
87
import 'package:spotify_downloader/features/presentation/settings/widgets/setting_with_text_field.dart';
@@ -77,20 +76,11 @@ class _AuthSettingsState extends State<AuthSettings> {
7776
BlocConsumer<AccountAuthBloc, AccountAuthState>(
7877
listener: (context, state) {
7978
if (state is AccountAuthFailure) {
80-
if (state.failure is! AuthFailure) {
81-
showFailureSnackBar(context, state.failure.toString());
82-
}
83-
}
84-
85-
if (state is AccountAuthInvalidCredentialsFailure) {
8679
showFailureSnackBar(context, state.failure.toString());
8780
}
8881
},
8982
bloc: _accountAuthBloc,
90-
buildWhen: (previous, current) => current is! AccountAuthFailure,
9183
builder: (context, state) {
92-
if (state is AccountAuthFailure) return Container();
93-
9484
return SizedBox(
9585
height: 30,
9686
child: Row(
@@ -117,12 +107,12 @@ class _AuthSettingsState extends State<AuthSettings> {
117107
);
118108
case AccountAuthNotAuthorized():
119109
return Text(S.of(context).youAreNotLoggedInToYourAccount, maxLines: 2);
120-
case AccountAuthFailure():
121-
return Text(S.of(context).unknownError, maxLines: 2);
122110
case AccountAuthNetworkFailure():
123111
return Text(S.of(context).connectionError, maxLines: 2);
124112
case AccountAuthInvalidCredentialsFailure():
125113
return Text(S.of(context).couldntLogInToYourAccount, maxLines: 2);
114+
case AccountAuthFailure():
115+
return Text(S.of(context).unknownError, maxLines: 2);
126116
}
127117
}),
128118
),
@@ -141,7 +131,7 @@ class _AuthSettingsState extends State<AuthSettings> {
141131
late final String buttonText;
142132
late final void Function() onButtonClicked;
143133

144-
if (state is AccountAuthAuthorized || state is AccountAuthNetworkFailure) {
134+
if (state is AccountAuthAuthorized) {
145135
buttonText = S.of(context).logOut;
146136
onButtonClicked = () => _accountAuthBloc.add(AccountAuthLogOut());
147137
} else {

pubspec.lock

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,10 @@ packages:
641641
dependency: transitive
642642
description:
643643
name: json_annotation
644-
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
644+
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
645645
url: "https://pub.dev"
646646
source: hosted
647-
version: "4.8.1"
647+
version: "4.9.0"
648648
leak_tracker:
649649
dependency: transitive
650650
description:
@@ -677,6 +677,14 @@ packages:
677677
url: "https://pub.dev"
678678
source: hosted
679679
version: "2.1.1"
680+
lists:
681+
dependency: transitive
682+
description:
683+
name: lists
684+
sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27"
685+
url: "https://pub.dev"
686+
source: hosted
687+
version: "1.0.1"
680688
logging:
681689
dependency: transitive
682690
description:
@@ -1170,6 +1178,14 @@ packages:
11701178
url: "https://pub.dev"
11711179
source: hosted
11721180
version: "1.3.2"
1181+
unicode:
1182+
dependency: transitive
1183+
description:
1184+
name: unicode
1185+
sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1"
1186+
url: "https://pub.dev"
1187+
source: hosted
1188+
version: "0.3.1"
11731189
url_launcher:
11741190
dependency: "direct main"
11751191
description:
@@ -1358,10 +1374,10 @@ packages:
13581374
dependency: "direct main"
13591375
description:
13601376
name: youtube_explode_dart
1361-
sha256: "89aff5ac7de139c492ecea4bfc9189d33791632fa57e7e438e598873b040b077"
1377+
sha256: "51ca5b2c03bf56060143d4f87df90ec3227592d7ae8a8003532533ae019d4291"
13621378
url: "https://pub.dev"
13631379
source: hosted
1364-
version: "2.0.4"
1380+
version: "2.3.6"
13651381
sdks:
13661382
dart: ">=3.4.3 <3.11.0"
13671383
flutter: ">=3.22.0"

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: App with which you can download tracks from Spotify using YouTube
33
publish_to: 'none'
44
repository: 'https://github.com/C0ntrolDev/spotify_downloader'
55

6-
version: 1.1.2+1
6+
version: 1.1.3+1
77

88
environment:
99
sdk: '>=3.1.4 <4.0.0'
@@ -24,7 +24,7 @@ dependencies:
2424
auto_route: ^7.8.4
2525
palette_generator: ^0.3.3+3
2626
ffmpeg_kit_flutter_full: ^6.0.3
27-
youtube_explode_dart: ^2.0.4
27+
youtube_explode_dart: ^2.3.6
2828
metadata_god: ^0.5.2
2929
cached_network_image: ^3.3.0
3030
path: ^1.8.3

0 commit comments

Comments
 (0)