Skip to content

Commit b100113

Browse files
authored
Merge pull request #10 from C0ntrolDev/dev-1.1
Ver 1.1.1
2 parents d50c90b + f4bcce2 commit b100113

File tree

66 files changed

+1049
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1049
-678
lines changed

.metadata

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e"
7+
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
17-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
16+
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
17+
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
1818
- platform: android
19-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
20-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
21-
- platform: ios
22-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
23-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
24-
- platform: linux
25-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
26-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
27-
- platform: macos
28-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
29-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
30-
- platform: web
31-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
32-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
33-
- platform: windows
34-
create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
35-
base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e
19+
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
20+
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
3621

3722
# User provided section
3823

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ 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.0/spotify_downloader.apk)
34+
- [spotify_downloader.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.1/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.0/spotify_downloader_armeabi-v7a.apk)
38-
- [spotify_downloader_arm64-v8a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.0/spotify_downloader_arm64-v8a.apk)
39-
- [spotify_downloader_x86_64.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.0/spotify_downloader_x86_64.apk)
37+
- [spotify_downloader_armeabi-v7a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.1/spotify_downloader_armeabi-v7a.apk)
38+
- [spotify_downloader_arm64-v8a.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.1/spotify_downloader_arm64-v8a.apk)
39+
- [spotify_downloader_x86_64.apk](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.1/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.0/spotify_downloader.ipa)
44+
- [spotify_downloader.ipa](https://github.com/C0ntrolDev/spotify_downloader/releases/download/v1.1.1/spotify_downloader.ipa)
4545

4646
## How to use
4747

48-
After you have downloaded the application, you must grant it the permissions it will ask for.
48+
After you have downloaded the app, you must grant it the permissions it will ask for.
4949
Then you can use the app. Just paste the link to the playlist and click the search button.
5050

5151
If you want to download your favorite tracks, and also download playlists "only for you", you must create Spotify Service App
@@ -73,6 +73,15 @@ __After logging in, you can download your favorite tracks, as well as playlists
7373
1. Developed on Flutter
7474
2. When developing the application, I used a "Clean Architecture". I don't think this application is an ideal representative of this approach. But if you want, you can use it as an example project.
7575

76+
### Version 2.0
77+
78+
If you're interested in contributing to this project, there are some key tasks I'd like to get done:
79+
80+
- [ ] Implement logging (probably using [talker](https://github.com/Frezyx/talker))
81+
- [ ] Implement caching for the most recently loaded pages
82+
- [ ] Remake the system for getting tracks from SpotifyAPI (make it so that the collection is fetched in parts, prioritizing loading parts that are visible)
83+
- [ ] Implement various sources of tracks/audio
84+
7685
<h3 align="center">
7786
^_^
78-
</h3>
87+
</h3>

ios/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ post_install do |installer|
4141
installer.pods_project.targets.each do |target|
4242
flutter_additional_ios_build_settings(target)
4343
target.build_configurations.each do |config|
44+
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
4445
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
4546
'$(inherited)',
4647
## dart: PermissionGroup.notification

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161
BAAF9E8CA93412EEA29D2F87 /* Pods-RunnerTests.release.xcconfig */,
162162
20C59286EA4762C02DB57A1E /* Pods-RunnerTests.profile.xcconfig */,
163163
);
164-
name = Pods;
165164
path = Pods;
166165
sourceTree = "<group>";
167166
};
@@ -467,6 +466,7 @@
467466
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
468467
buildSettings = {
469468
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
469+
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
470470
CLANG_ENABLE_MODULES = YES;
471471
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
472472
DEVELOPMENT_TEAM = 642R69GYA2;
@@ -476,7 +476,7 @@
476476
"$(inherited)",
477477
"@executable_path/Frameworks",
478478
);
479-
PRODUCT_BUNDLE_IDENTIFIER = com.c0dev.spotifyDownloader;
479+
PRODUCT_BUNDLE_IDENTIFIER = com.cdev.spotifyDownloader;
480480
PRODUCT_NAME = "$(TARGET_NAME)";
481481
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
482482
SWIFT_VERSION = 5.0;
@@ -646,6 +646,7 @@
646646
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
647647
buildSettings = {
648648
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
649+
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
649650
CLANG_ENABLE_MODULES = YES;
650651
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
651652
DEVELOPMENT_TEAM = 642R69GYA2;
@@ -655,7 +656,7 @@
655656
"$(inherited)",
656657
"@executable_path/Frameworks",
657658
);
658-
PRODUCT_BUNDLE_IDENTIFIER = com.c0dev.spotifyDownloader;
659+
PRODUCT_BUNDLE_IDENTIFIER = com.cdev.spotifyDownloader;
659660
PRODUCT_NAME = "$(TARGET_NAME)";
660661
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
661662
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -669,6 +670,7 @@
669670
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
670671
buildSettings = {
671672
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
673+
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
672674
CLANG_ENABLE_MODULES = YES;
673675
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
674676
DEVELOPMENT_TEAM = 642R69GYA2;
@@ -678,7 +680,7 @@
678680
"$(inherited)",
679681
"@executable_path/Frameworks",
680682
);
681-
PRODUCT_BUNDLE_IDENTIFIER = com.c0dev.spotifyDownloader;
683+
PRODUCT_BUNDLE_IDENTIFIER = com.cdev.spotifyDownloader;
682684
PRODUCT_NAME = "$(TARGET_NAME)";
683685
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
684686
SWIFT_VERSION = 5.0;
File renamed without changes.

lib/core/app/colors/colors.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const errorPrimaryColor = Color.fromARGB(255, 255, 102, 91);
2020
const searchFieldColor = Color.fromARGB(255, 255, 255, 255);
2121
const searchFieldHintColor = Color.fromARGB(255, 59, 59, 59);
2222

23-
const dialogColor = Color.fromARGB(255, 59, 59, 59);
23+
const dialogColor = Color.fromARGB(255, 30, 30, 30);
2424

2525
const tilePlaceholderColor = Color.fromARGB(255, 59, 59, 59);
2626

lib/core/app/spotify_downloader_app.dart

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
44
import 'package:package_info_plus/package_info_plus.dart';
55
import 'package:spotify_downloader/core/app/router/router.dart';
66
import 'package:spotify_downloader/core/app/themes/themes.dart';
7-
import 'package:spotify_downloader/core/package_info/package_info_accessor.dart';
7+
import 'package:spotify_downloader/core/accessors/package_info/package_info_accessor.dart';
88
import 'package:spotify_downloader/generated/l10n.dart';
99

1010
class SpotifyDownloaderApp extends StatefulWidget {
@@ -23,6 +23,7 @@ class SpotifyDownloaderApp extends StatefulWidget {
2323
}
2424

2525
class _SpotifyDownloaderAppState extends State<SpotifyDownloaderApp> {
26+
final navigatorKey = GlobalKey();
2627
final _appRouter = AppRouter();
2728
String _language = 'en';
2829

@@ -33,28 +34,28 @@ class _SpotifyDownloaderAppState extends State<SpotifyDownloaderApp> {
3334
if (widget.locale != null) {
3435
_language = widget.locale!;
3536
}
37+
3638
initTheme();
3739
}
3840

3941
@override
4042
Widget build(BuildContext context) {
4143
return MaterialApp.router(
42-
locale: Locale(_language),
43-
localizationsDelegates: const [
44-
S.delegate,
45-
GlobalMaterialLocalizations.delegate,
46-
GlobalWidgetsLocalizations.delegate,
47-
GlobalCupertinoLocalizations.delegate,
48-
],
49-
supportedLocales: S.delegate.supportedLocales,
50-
routerConfig: _appRouter.config(navigatorObservers: () => [AutoRouteObserver()]),
51-
theme: mainTheme,
52-
builder: (context, child) {
53-
return ScrollConfiguration(
54-
behavior: const ClampingScrollPhysicsBehavior().copyWith(overscroll: false),
55-
child: PackageInfoAccessor(packageInfo: widget.packageInfo, child: child!));
56-
},
57-
);
44+
locale: Locale(_language),
45+
localizationsDelegates: const [
46+
S.delegate,
47+
GlobalMaterialLocalizations.delegate,
48+
GlobalWidgetsLocalizations.delegate,
49+
GlobalCupertinoLocalizations.delegate,
50+
],
51+
supportedLocales: S.delegate.supportedLocales,
52+
routerConfig: _appRouter.config(navigatorObservers: () => [AutoRouteObserver()]),
53+
theme: mainTheme,
54+
builder: (context, child) {
55+
return ScrollConfiguration(
56+
behavior: const ClampingScrollPhysicsBehavior().copyWith(overscroll: false),
57+
child: PackageInfoAccessor(packageInfo: widget.packageInfo, child: child!));
58+
});
5859
}
5960

6061
changeLanguage(String language) {
@@ -63,3 +64,4 @@ class _SpotifyDownloaderAppState extends State<SpotifyDownloaderApp> {
6364
});
6465
}
6566
}
67+

lib/core/app/themes/themes.dart

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -87,37 +87,6 @@ void initTheme() {
8787
systemNavigationBarColor: Colors.transparent,
8888
),
8989
);
90-
}
91-
92-
void showBigTextSnackBar(String message, BuildContext context, [Duration duration = const Duration(seconds: 2)]) {
93-
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
94-
content: Column(
95-
children: [
96-
Text(
97-
message,
98-
textAlign: TextAlign.center,
99-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(overflow: TextOverflow.visible),
100-
),
101-
],
102-
),
103-
duration: duration,
104-
));
105-
}
106-
107-
void showSmallTextSnackBar(String message, BuildContext context, [Duration duration = const Duration(seconds: 2)]) {
108-
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
109-
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))),
110-
content: Column(
111-
children: [
112-
Text(
113-
message,
114-
textAlign: TextAlign.center,
115-
style: Theme.of(context).textTheme.labelMedium?.copyWith(overflow: TextOverflow.visible),
116-
),
117-
],
118-
),
119-
duration: duration,
120-
));
12190
}
12291

12392
class TransitionsBuildersExtension {

lib/core/di/injector.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import 'package:spotify_downloader/features/data_domain/auth/network_auth/networ
99
import 'package:spotify_downloader/features/data_domain/auth/service/service.dart';
1010
import 'package:spotify_downloader/features/data_domain/settings/settings.dart';
1111
import 'package:spotify_downloader/features/data_domain/spotify_profile/spotify_profile.dart';
12-
import 'package:spotify_downloader/features/data_domain/tracks/download_tracks/data/data_sources/tools/audio_metadata_editor/audio_metadata_editor_impl.dart';
12+
import 'package:spotify_downloader/features/data_domain/tracks/download_tracks/data/data_sources/tools/audio_metadata_editor/metadata_god_audio_metadata_editor_impl.dart';
13+
import 'package:spotify_downloader/features/data_domain/tracks/download_tracks/data/data_sources/tools/bitrate_editor/low_level_bitrate_editor_impl.dart';
1314
import 'package:spotify_downloader/features/data_domain/tracks/download_tracks/data/data_sources/tools/file_to_mp3_converter/ffmpeg_file_to_mp3_converter.dart';
1415
import 'package:spotify_downloader/features/data_domain/tracks/download_tracks/download_tracks.dart';
1516
import 'package:spotify_downloader/features/data_domain/tracks/local_tracks/local_tracks.dart';
@@ -64,7 +65,7 @@ Future<void> _provideDataSources() async {
6465
TracksCollectonsHistoryDataSource(localDb: injector.get<LocalDb>()));
6566
injector.registerSingleton<NetworkTracksCollectionsDataSource>(NetworkTracksCollectionsDataSource());
6667
injector.registerSingleton<DownloadAudioFromYoutubeDataSource>(DownloadAudioFromYoutubeDataSource(
67-
audioMetadataEditor: AudioMetadataEditorImpl(), fileToMp3Converter: FFmpegFileToMp3Converter()));
68+
audioMetadataEditor: MetadataGodAudioMetadataEditorImpl(), fileToMp3Converter: FFmpegFileToMp3Converter(), audioBitrateEditor: LowLevelMp3AudioBitrateEditorImpl()));
6869
await injector.get<DownloadAudioFromYoutubeDataSource>().init();
6970
injector.registerSingleton<NetworkTracksDataSource>(NetworkTracksDataSource());
7071
await injector.get<NetworkTracksDataSource>().init();
Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,43 @@
11
import 'package:spotify_downloader/core/utils/failures/failure.dart';
22

3-
final class NotFoundFailure extends Failure {
4-
const NotFoundFailure({super.message = 'not found failure'});
3+
abstract class NoDetailedFailure extends Failure {
4+
const NoDetailedFailure({required super.message, super.stackTrace});
5+
6+
@override
7+
String toString() {
8+
final type = runtimeType;
9+
return '$type: $message';
10+
}
511
}
612

7-
final class NetworkFailure extends Failure {
8-
const NetworkFailure({super.message = 'network failure'});
13+
final class NotFoundFailure extends NoDetailedFailure {
14+
const NotFoundFailure({super.message = 'not found failure', super.stackTrace});
915
}
1016

11-
final class ConverterFailure extends Failure {
12-
const ConverterFailure({super.message = 'converter failure'});
17+
final class NetworkFailure extends NoDetailedFailure {
18+
const NetworkFailure({super.message = 'network failure', super.stackTrace});
1319
}
1420

15-
final class AuthFailure extends Failure {
16-
AuthFailure({super.message = 'auth failure'});
21+
final class ConverterFailure extends NoDetailedFailure {
22+
const ConverterFailure({super.message = 'converter failure', super.stackTrace});
1723
}
1824

19-
final class InvalidClientCredentialsFailure extends Failure {
20-
InvalidClientCredentialsFailure({super.message = 'invalid auth credentials failure'});
25+
final class AuthFailure extends NoDetailedFailure {
26+
AuthFailure({super.message = 'auth failure', super.stackTrace});
2127
}
2228

23-
final class InvalidAccountCredentialsFailure extends Failure {
24-
InvalidAccountCredentialsFailure({super.message = 'invalid refresh token failure'});
29+
final class InvalidClientCredentialsFailure extends NoDetailedFailure {
30+
InvalidClientCredentialsFailure({super.message = 'invalid auth credentials failure', super.stackTrace});
2531
}
2632

27-
final class NotAuthorizedFailure extends Failure {
28-
NotAuthorizedFailure({super.message = 'User not authorized'});
33+
final class InvalidAccountCredentialsFailure extends NoDetailedFailure {
34+
InvalidAccountCredentialsFailure({super.message = 'invalid refresh token failure', super.stackTrace});
2935
}
3036

31-
final class ForbiddenFailure extends Failure {
32-
ForbiddenFailure({super.message = 'Access Forbidden'});
33-
}
37+
final class NotAuthorizedFailure extends NoDetailedFailure {
38+
NotAuthorizedFailure({super.message = 'User not authorized', super.stackTrace});
39+
}
40+
41+
final class ForbiddenFailure extends NoDetailedFailure {
42+
ForbiddenFailure({super.message = 'Access Forbidden', super.stackTrace});
43+
}

0 commit comments

Comments
 (0)