mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
Unsafe List.last accessor bugfix (#issues/2)
PKGBUILD recreated & adjusted License created flatpak config created (dummy)
This commit is contained in:
parent
a820e8a9f6
commit
44760aab6f
12
LICENSE
Normal file
12
LICENSE
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
BSD 4-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Kingkor Roy Tirtho. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
|
||||||
|
This product includes software developed by Kingkor Roy Tirtho.
|
||||||
|
4. Neither the name of the Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
THIS SOFTWARE IS PROVIDED BY KINGKOR ROY TIRTHO AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KINGKOR ROY TIRTHO AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@ -1,13 +1,11 @@
|
|||||||
pkgbase = spotube-bin
|
pkgbase = spotube
|
||||||
pkgdesc = A music streaming app combining the power of Spotify & Youtube
|
pkgdesc = A lightweight free Spotify desktop-client which handles playback manually, streams music using Youtube & no Spotify premium account is needed
|
||||||
pkgver = 0.0.3
|
pkgver = 1.0.0
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://github.com/KRTirtho/spotube/
|
url = https://github.com/KRTirtho/spotube/
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
license = MIT
|
license = BSD 4-Clause
|
||||||
depends = mpv
|
source = https://github.com/KRTirtho/spotube/releases/download/v1.0.0/Spotube-linux-x86_64.tar.xz
|
||||||
depends = youtube-dl
|
|
||||||
source = https://github.com/KRTirtho/spotube//releases/download/v0.0.3/Spotube_linux-x86_64-v0.0.3.zip
|
|
||||||
|
|
||||||
pkgname = spotube-bin
|
pkgname = spotube
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
# Maintainer: KRTirtho <krtirho@gmail.com>
|
# Maintainer: Kingkor Roy Tirtho <krtirho@gmail.com>
|
||||||
pkgname=spotube
|
pkgname=spotube
|
||||||
pkgver=1.0.0
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
epoch=
|
epoch=
|
||||||
pkgdesc="A music streaming app combining the power of Spotify & Youtube"
|
pkgdesc="A lightweight free Spotify desktop-client which handles playback manually, streams music using Youtube & no Spotify premium account is needed"
|
||||||
arch=(x86_64)
|
arch=(x86_64)
|
||||||
url="https://github.com/KRTirtho/spotube/"
|
url="https://github.com/KRTirtho/spotube/"
|
||||||
license=('MIT')
|
license=('BSD 4-Clause')
|
||||||
groups=()
|
groups=()
|
||||||
depends=('mpv' 'yt-dlp')
|
depends=()
|
||||||
makedepends=()
|
makedepends=()
|
||||||
checkdepends=()
|
checkdepends=()
|
||||||
optdepends=()
|
optdepends=()
|
||||||
@ -19,17 +19,18 @@ backup=()
|
|||||||
options=()
|
options=()
|
||||||
install=
|
install=
|
||||||
changelog=
|
changelog=
|
||||||
source=("./spotube-v1.0.0-linux-x86-64.tar")
|
source=("https://github.com/KRTirtho/spotube/releases/download/v${version}/Spotube-linux-x86_64.tar.xz")
|
||||||
noextract=()
|
noextract=()
|
||||||
md5sums=(a58727a9233d7d381872be59b622f864)
|
md5sums=(f1830c1edf38c236416bdd3bd33ec845)
|
||||||
validpgpkeys=()
|
validpgpkeys=()
|
||||||
|
|
||||||
package(){
|
package(){
|
||||||
install -dm755 "${pkgdir}/usr/share/icons/${pkgname}"
|
install -dm755 "${pkgdir}/usr/share/icons/${pkgname}"
|
||||||
|
install -dm755 "${pkgdir}/usr/share/applications"
|
||||||
install -dm755 "${pkgdir}/usr/share/${pkgname}"
|
install -dm755 "${pkgdir}/usr/share/${pkgname}"
|
||||||
install -dm755 "${pkgdir}/usr/bin"
|
install -dm755 "${pkgdir}/usr/bin"
|
||||||
cp -ra ./ "${pkgdir}/usr/share/${pkgname}"
|
cp -ra ./ "${pkgdir}/usr/share/${pkgname}"
|
||||||
cp ./spotube.desktop ~/.local/share/applications
|
cp ./spotube.desktop "${pkgdir}/usr/share/applications"
|
||||||
cp ./data/flutter_assets/assets/spotube-logo.png "${pkgdir}/usr/share/icons/${pkgname}"
|
cp ./spotube-logo.png "${pkgdir}/usr/share/icons/${pkgname}"
|
||||||
ln -s "/usr/share/${pkgname}/spotube" "${pkgdir}/usr/bin/${pkgname}"
|
ln -s "/usr/share/${pkgname}/spotube" "${pkgdir}/usr/bin/${pkgname}"
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,11 @@ class _HomeState extends State<Home> {
|
|||||||
return FutureBuilder<User>(
|
return FutureBuilder<User>(
|
||||||
future: data.spotifyApi.me.get(),
|
future: data.spotifyApi.me.get(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
var avatarImg = snapshot.data?.images?.last.url;
|
var avatarImg = ((snapshot.data?.images?.isNotEmpty ??
|
||||||
|
false) &&
|
||||||
|
snapshot.data?.images?.last.url != null)
|
||||||
|
? snapshot.data!.images!.last.url!
|
||||||
|
: "https://avatars.dicebear.com/api/human/${snapshot.data?.id}.png";
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -193,11 +197,10 @@ class _HomeState extends State<Home> {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (avatarImg != null)
|
CircleAvatar(
|
||||||
CircleAvatar(
|
backgroundImage:
|
||||||
backgroundImage:
|
CachedNetworkImageProvider(avatarImg),
|
||||||
CachedNetworkImageProvider(avatarImg),
|
),
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
snapshot.data?.displayName ?? "User's name",
|
snapshot.data?.displayName ?? "User's name",
|
||||||
|
@ -227,7 +227,10 @@ class _PlayerState extends State<Player> with WidgetsBindingObserver {
|
|||||||
_playTrack(playback.currentTrack!, playback);
|
_playTrack(playback.currentTrack!, playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
String? albumArt = playback.currentTrack?.album?.images?.last.url;
|
String? albumArt =
|
||||||
|
(playback.currentTrack?.album?.images?.isNotEmpty ?? false)
|
||||||
|
? playback.currentTrack?.album?.images?.last.url
|
||||||
|
: null;
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
|
@ -17,8 +17,10 @@ class PlaylistView extends StatefulWidget {
|
|||||||
class _PlaylistViewState extends State<PlaylistView> {
|
class _PlaylistViewState extends State<PlaylistView> {
|
||||||
List<TableRow> trackToTableRow(List<Track> tracks) {
|
List<TableRow> trackToTableRow(List<Track> tracks) {
|
||||||
return tracks.asMap().entries.map((track) {
|
return tracks.asMap().entries.map((track) {
|
||||||
var thumbnailUrl = track.value.album?.images?.last.url;
|
String? thumbnailUrl = (track.value.album?.images?.isNotEmpty ?? false)
|
||||||
var duration =
|
? track.value.album?.images?.last.url
|
||||||
|
: null;
|
||||||
|
String duration =
|
||||||
"${track.value.duration?.inMinutes.remainder(60)}:${zeroPadNumStr(track.value.duration?.inSeconds.remainder(60) ?? 0)}";
|
"${track.value.duration?.inMinutes.remainder(60)}:${zeroPadNumStr(track.value.duration?.inSeconds.remainder(60) ?? 0)}";
|
||||||
return (TableRow(
|
return (TableRow(
|
||||||
children: [
|
children: [
|
||||||
|
13
oss.krtirtho.Spotube.yml
Normal file
13
oss.krtirtho.Spotube.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
app-id: oss.krtirtho.Spotube
|
||||||
|
runtime: org.freedesktop.Platform
|
||||||
|
runtime-version: '21.08'
|
||||||
|
sdk: org.freedesktop.Sdk
|
||||||
|
command: spotube
|
||||||
|
modules:
|
||||||
|
- name: spotube
|
||||||
|
buildsystem: simple
|
||||||
|
build-commands:
|
||||||
|
- install -D hello.sh /app/bin/hello.sh
|
||||||
|
sources:
|
||||||
|
- type: file
|
||||||
|
path: hello.sh
|
Loading…
Reference in New Issue
Block a user