diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml
deleted file mode 100644
index 4f8f29ec..00000000
--- a/.github/workflows/flutter-build.yml
+++ /dev/null
@@ -1,89 +0,0 @@
-name: Flutter Cross Build
-on:
- push:
- branches:
- - build
- workflow_dispatch:
-
-jobs:
- build_ubuntu:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v2.2.0
- with:
- cache: true
- - run: |
- sudo apt-get update -y
- sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
- - run: flutter config --enable-linux-desktop
- - run: flutter pub get
- - run: dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- - run: flutter clean
- - run: flutter build linux
- - run: make deb
- - run: make tar
- - run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
- - run: chmod +x /usr/local/bin/appimagetool
- - run: pip3 install appimage-builder
- - run: make appimage
- - uses: actions/upload-artifact@v2
- with:
- name: Spotube-Linux-Bundle
- path: |
- build/Spotube-linux-x86_64.deb
- build/Spotube-linux-x86_64.tar.xz
- build/Spotube-*-x86_64.AppImage
- # Building Android Application
- - run: echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
- - run: echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
- - run: flutter build apk
- - run: make apk
- - uses: actions/upload-artifact@v2
- with:
- name: Spotube-Android-Bundle
- path: |
- build/Spotube-android-all-arch.apk
- build_windows:
- runs-on: windows-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions/checkout@v3
- with:
- repository: KRTirtho/flutter_distributor
- ref: deb-implementation
- path: build/flutter_distributor
- - uses: subosito/flutter-action@v2.2.0
- with:
- cache: true
- - run: flutter config --enable-windows-desktop
- - run: flutter pub get
- - run: dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- - run: choco install innosetup -y
- - run: dart pub global activate melos
- - run: cd build/flutter_distributor && melos bootstrap && cd ../..
- - run: dart build/flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=windows --targets=exe --skip-clean
- - uses: actions/upload-artifact@v3
- with:
- name: Spotube-Windows-Bundle
- path: |
- dist/**/*.exe
- build_macos:
- runs-on: macos-11
- steps:
- - uses: actions/checkout@v2
- - uses: subosito/flutter-action@v2
- with:
- cache: true
- - run: flutter config --enable-macos-desktop
- - run: flutter pub get
- - run: dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- - run: flutter build macos
- - run: du -sh build/macos/Build/Products/Release/spotube.app
- - run: npm install -g appdmg
- - run: appdmg appdmg.json build/Spotube-macos-x86_64.dmg
- - uses: actions/upload-artifact@v2
- with:
- name: Spotube-Macos-Bundle
- path: |
- build/Spotube-macos-x86_64.dmg
diff --git a/.github/workflows/spotube-nightly.yml b/.github/workflows/spotube-nightly.yml
new file mode 100644
index 00000000..5600ab46
--- /dev/null
+++ b/.github/workflows/spotube-nightly.yml
@@ -0,0 +1,134 @@
+name: Spotube Nightly
+on:
+ push:
+ branches:
+ - build
+ workflow_dispatch:
+
+jobs:
+ build_ubuntu:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get latest tag
+ id: tag
+ uses: dawidd6/action-get-tag@v1
+ with:
+ strip_v: true
+ - uses: subosito/flutter-action@v2
+ with:
+ cache: true
+ - name: Get current date
+ id: date
+ run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
+ - run: |
+ sudo apt-get update -y
+ sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
+ - run: |
+ wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.0.0-beta.1/appimage-builder-1.0.0-677acbd-x86_64.AppImage
+ chmod +x appimage-builder-x86_64.AppImage
+ mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
+ # replacing & adding new release version with older version
+ - run: |
+ sed -i 's|%{{APPDATA_RELEASE}}%||' linux/com.github.KRTirtho.Spotube.appdata.xml
+
+ - run: |
+ flutter config --enable-linux-desktop
+ flutter pub get
+ dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
+ dart pub global activate flutter_distributor
+ flutter_distributor package --platform=linux --targets=deb,appimage --skip-clean
+ make tar
+ - run: |
+ mv build/Spotube-linux-x86_64.tar.xz dist/
+ mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64.deb
+ mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64.AppImage
+ - uses: actions/upload-artifact@v3
+ with:
+ name: Spotube-Linux-Bundle
+ path: dist/
+
+ build_android:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get latest tag
+ id: tag
+ uses: dawidd6/action-get-tag@v1
+ with:
+ strip_v: true
+ - uses: subosito/flutter-action@v2
+ with:
+ cache: true
+ - run: |
+ sudo apt-get update -y
+ sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
+ - run: |
+ flutter pub get
+ dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
+ dart pub global activate flutter_distributor
+ flutter_distributor package --platform=android --targets=apk --skip-clean
+ - run: |
+ mv dist/**/spotube-*-android.apk dist/Spotube-android-all-arch.apk
+ - uses: actions/upload-artifact@v3
+ with:
+ name: Spotube-Android-Bundle
+ path: dist/
+
+ build_windows:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get latest tag
+ id: tag
+ uses: dawidd6/action-get-tag@v1
+ with:
+ # Optionally strip `v` prefix
+ strip_v: true
+ # Replace Version in files
+ - run: |
+ choco install sed make -y
+ sed -i "s/%{{SPOTUBE_VERSION}}%/${{ steps.tag.outputs.tag }}/" windows/runner/Runner.rc
+
+ # Build Windows Executable
+ - uses: subosito/flutter-action@v2.2.0
+ with:
+ cache: true
+ - run: |
+ flutter config --enable-windows-desktop
+ flutter pub get
+ dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
+ dart pub global activate flutter_distributor
+ make innoinstall
+ flutter_distributor package --platform=windows --targets=exe --skip-clean
+
+ # Create Chocolatey Package
+ # setting the sha256 hash for new bundle
+ - run: mv dist/**/spotube-*-windows-setup.exe dist/Spotube-windows-x86_64-setup.exe
+
+ # Upload artifacts
+ - uses: actions/upload-artifact@v3
+ with:
+ name: Spotube-Windows-Bundle
+ path: dist/
+
+
+ build_macos:
+ runs-on: macos-11
+ steps:
+ - uses: actions/checkout@v2
+ - uses: subosito/flutter-action@v2
+ with:
+ cache: true
+ - run: flutter config --enable-macos-desktop
+ - run: flutter pub get
+ - run: dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
+ - run: flutter build macos
+ - run: du -sh build/macos/Build/Products/Release/spotube.app
+ - run: npm install -g appdmg
+ - run: appdmg appdmg.json build/Spotube-macos-x86_64.dmg
+ - uses: actions/upload-artifact@v2
+ with:
+ name: Spotube-Macos-Bundle
+ path: |
+ build/Spotube-macos-x86_64.dmg
\ No newline at end of file
diff --git a/.github/workflows/release-build.yml b/.github/workflows/spotube-release.yml
similarity index 87%
rename from .github/workflows/release-build.yml
rename to .github/workflows/spotube-release.yml
index becf00bf..1951583c 100644
--- a/.github/workflows/release-build.yml
+++ b/.github/workflows/spotube-release.yml
@@ -1,4 +1,4 @@
-name: Spotube Build & Release
+name: Spotube Release
on:
release:
types:
@@ -36,9 +36,8 @@ jobs:
flutter pub get
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
dart pub global activate melos
- cd build/flutter_distributor && melos bootstrap && cd ../..
make innoinstall
- dart build/flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=windows --targets=exe --skip-clean
+ flutter_distributor package --platform=windows --targets=exe --skip-clean
# Create Chocolatey Package
# setting the sha256 hash for new bundle
@@ -93,11 +92,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - uses: actions/checkout@v3
- with:
- repository: KRTirtho/flutter_distributor
- ref: deb-implementation
- path: build/flutter_distributor
- name: Get latest tag
id: tag
uses: dawidd6/action-get-tag@v1
@@ -111,7 +105,7 @@ jobs:
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- run: |
sudo apt-get update -y
- sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
+ sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- run: |
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.0.0-beta.1/appimage-builder-1.0.0-677acbd-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
@@ -124,9 +118,8 @@ jobs:
flutter config --enable-linux-desktop
flutter pub get
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- dart pub global activate melos
- cd build/flutter_distributor && melos bootstrap && cd ../..
- dart build/flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=linux --targets=deb,appimage --skip-clean
+ dart pub global activate flutter_distributor
+ flutter_distributor package --platform=linux --targets=deb,appimage --skip-clean
make tar
- run: |
mv build/Spotube-linux-x86_64.tar.xz dist/
@@ -141,11 +134,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - uses: actions/checkout@v3
- with:
- repository: KRTirtho/flutter_distributor
- ref: deb-implementation
- path: build/flutter_distributor
- name: Get latest tag
id: tag
uses: dawidd6/action-get-tag@v1
@@ -156,13 +144,12 @@ jobs:
cache: true
- run: |
sudo apt-get update -y
- sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
+ sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
- run: |
flutter pub get
dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}'
- dart pub global activate melos
- cd build/flutter_distributor && melos bootstrap && cd ../..
- dart build/flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=android --targets=apk --skip-clean
+ dart pub global activate flutter_distributor
+ flutter_distributor package --platform=android --targets=apk --skip-clean
- run: |
mv dist/**/spotube-*-android.apk dist/Spotube-android-all-arch.apk
- uses: actions/upload-artifact@v3
diff --git a/.vscode/settings.json b/.vscode/settings.json
index cad7657d..44bf8e0a 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,3 +1,6 @@
{
- "cmake.configureOnOpen": false
+ "cmake.configureOnOpen": false,
+ "cSpell.words": [
+ "Mpris"
+ ]
}
\ No newline at end of file
diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md
index c218df9a..db5423a8 100644
--- a/CONTRIBUTION.md
+++ b/CONTRIBUTION.md
@@ -12,12 +12,16 @@ All types of contributions are encouraged and valued. See the [Table of Contents
## Table of Contents
-- [Code of Conduct](#code-of-conduct)
-- [I Have a Question](#i-have-a-question)
-- [I Want To Contribute](#i-want-to-contribute)
-- [Reporting Bugs](#reporting-bugs)
-- [Suggesting Enhancements](#suggesting-enhancements)
-- [Your First Code Contribution](#your-first-code-contribution)
+- [Contributing to Spotube](#contributing-to-spotube)
+ - [Table of Contents](#table-of-contents)
+ - [Code of Conduct](#code-of-conduct)
+ - [I Have a Question](#i-have-a-question)
+ - [I Want To Contribute](#i-want-to-contribute)
+ - [Reporting Bugs](#reporting-bugs)
+ - [Before Submitting a Bug Report](#before-submitting-a-bug-report)
+ - [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report)
+ - [Suggesting Enhancements](#suggesting-enhancements)
+ - [Your First Code Contribution](#your-first-code-contribution)
## Code of Conduct
@@ -109,11 +113,12 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/KRTirt
### Your First Code Contribution
+
Do the following:
- Download the latest Flutter SDK (>=2.15.1) & enable desktop support
- Install Development dependencies in linux
- - `libwebkit2gtk-4.0-dev`, `libkeybinder-3.0-0` & `libkeybinder-3.0-dev` (for Debian/Ubuntu)
- - `webkit2gtk` & `libkeybinder3` (for Arch/Manjaro)
+ - `libgstreamer1.0-dev` & `libgstreamer-plugins-base1.0-dev` (for Debian/Ubuntu)
+ - `gstreamer`, `gst-libav`, `gst-plugins-base` & `gst-plugins-good` (for Arch/Manjaro)
- Clone the Repo & Run `flutter pub get` in the Terminal
- Create a `secrets.json` in root of the project. The structure should be similar to the following example:
```jsoc name="secrets.json"
@@ -137,7 +142,7 @@ Do the following:
> You can add more clientId/clientSecret/genius-access-token if you want. The credentials used in the example are dummy (fake). You've to use your own secrets
- Finally run these following commands in the root of the project to start the Spotube Locally
```bash
- $ dart create-secrets.dart --local
+ $ dart bin/create-secrets.dart --local
$ flutter run -d )>
```
diff --git a/README.md b/README.md
index 41117801..807516d8 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,7 @@ I'm always releasing newer versions of binary of the software each 2-3 month wit
| Platform | Package/Installation Method |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| Android | [
][android-dlink] |
+| Android | [
][android-dlink]
[
][fdroid-dlink]|
| Debian/Ubuntu | [
][deb-dlink]
Then run: `sudo apt install Spotube-linux-x86_64.deb` |
| Flatpak | `flatpak install com.github.KRTirtho.Spotube`
|
| Arch/Manjaro | pamac: `pamac install spotube-bin`
yay: `yay -Sy spotube-bin` |
@@ -127,8 +127,7 @@ Bu why? You can learn about it [here](https://dev.to/krtirtho/choosing-open-sour
- [AUR](https://aur.archlinux.org/) - AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users
- [Flatpak](https://flatpak.org/) - Flatpak is a utility for software deployment and package management for Linux
- [spotify (dart)](https://github.com/rinukkusu/spotify-dart) - A dart library for interfacing with the Spotify API
-- [just_audio](https://github.com/ryanheise/just_audio/tree/master/just_audio) - A feature-rich cross-platform audio player for Flutter that supports network audio streams too
-- [libwinmedia](https://github.com/harmonoid/libwinmedia) - A cross-platform media playback library for C/C++ with good number of features (only Windows & Linux)
+- [audioplayers](https://github.com/bluefireteam/audioplayers) - A Flutter plugin to play multiple audio files simultaneously (Android/iOS)
- [youtube_explode_dart](https://github.com/Hexer10/youtube_explode_dart) - YoutubeExplode is a library that provides an interface to query metadata of YouTube videos, playlists and channels, as well as to resolve and download video streams and closed caption tracks
- [infinite_scroll_pagination](https://github.com/EdsonBueno/infinite_scroll_pagination) - Flutter package to help you lazily load and display pages of items as the user scrolls down your screen
- [bitsdojo_window](https://github.com/bitsdojo/bitsdojo_window) - A Flutter package that makes it easy to customize and work with your Flutter desktop app window on Windows, macOS and Linux
@@ -165,5 +164,6 @@ Follow me on [Twitter](https://twitter.com/@krtirtho) for newer updates about th
[appimage-dlink]: https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-linux-x86_64.AppImage
[mac-dlink]: https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-macos-x86_64.dmg
[android-dlink]: https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-android-all-arch.apk
+[fdroid-dlink]: https://f-droid.org/packages/oss.krtirtho.spotube/
[wiki-installation-instructions]: https://github.com/KRTirtho/spotube/wiki/Installation-Instrcutions
diff --git a/lib/components/Album/AlbumCard.dart b/lib/components/Album/AlbumCard.dart
index 5e838e0c..465d79e2 100644
--- a/lib/components/Album/AlbumCard.dart
+++ b/lib/components/Album/AlbumCard.dart
@@ -18,15 +18,15 @@ class AlbumCard extends HookConsumerWidget {
@override
Widget build(BuildContext context, ref) {
Playback playback = ref.watch(playbackProvider);
- bool isPlaylistPlaying = playback.currentPlaylist != null &&
- playback.currentPlaylist!.id == album.id;
+ bool isPlaylistPlaying =
+ playback.playlist != null && playback.playlist!.id == album.id;
final int marginH =
useBreakpointValue(sm: 10, md: 15, lg: 20, xl: 20, xxl: 20);
return PlaybuttonCard(
imageUrl: imageToUrlString(album.images),
margin: EdgeInsets.symmetric(horizontal: marginH.toDouble()),
- isPlaying: playback.currentPlaylist?.id != null &&
- playback.currentPlaylist?.id == album.id,
+ isPlaying:
+ playback.playlist?.id != null && playback.playlist?.id == album.id,
title: album.name!,
description:
"Album • ${artistsToString(album.artists ?? [])}",
@@ -41,14 +41,12 @@ class AlbumCard extends HookConsumerWidget {
.toList();
if (tracks.isEmpty) return;
- playback.setCurrentPlaylist = CurrentPlaylist(
+ await playback.playPlaylist(CurrentPlaylist(
tracks: tracks,
id: album.id!,
name: album.name!,
thumbnail: album.images!.first.url!,
- );
- playback.setCurrentTrack = tracks.first;
- await playback.startPlaying();
+ ));
},
);
}
diff --git a/lib/components/Album/AlbumView.dart b/lib/components/Album/AlbumView.dart
index 78c96093..deca5aac 100644
--- a/lib/components/Album/AlbumView.dart
+++ b/lib/components/Album/AlbumView.dart
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
-import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/components/Shared/HeartButton.dart';
@@ -18,24 +17,25 @@ class AlbumView extends HookConsumerWidget {
final AlbumSimple album;
const AlbumView(this.album, {Key? key}) : super(key: key);
- playPlaylist(Playback playback, List