Compare commits

..

No commits in common. "773cf12b97ceb1e00c0591e059c982cfeb6e8612" and "052f89890b453b464cd6e7c18af9327e9c8135f7" have entirely different histories.

9 changed files with 18 additions and 28 deletions

View file

@ -79,7 +79,6 @@ class AudioPlayerService {
themeNotifier.value = await ColorScheme.fromImageProvider(
provider: CachedNetworkImageProvider(
AudioPlayerService().song!.coverArtUrl,
cacheKey: AudioPlayerService().song!.coverArtId,
),
);
logger.d(AudioPlayerService().song!.coverArtUrl);
@ -183,7 +182,7 @@ class AudioPlayerService {
);
await _player.setAudioSource(
_queue,
initialIndex: queuePast.length,
initialIndex: queuePast.isEmpty ? 0 : queuePast.length - 1,
initialPosition: Duration.zero,
);

View file

@ -37,5 +37,5 @@ class Artist {
final String artistImageUrl;
/// Returns the cover art URL formed from the [coverArtId]
String get coverArtUrl => SubsonicApiService().getCoverArtUrl(coverArtId);
String get coverArt => SubsonicApiService().getCoverArtUrl(coverArtId);
}

View file

@ -43,7 +43,6 @@ class _AlbumViewState extends State<AlbumView> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
HeroBanner(
cacheKey: widget.album.coverArtId,
imageUrl: widget.album.coverArtUrl,
title: widget.album.name,
description: widget.album.artistName,

View file

@ -45,8 +45,7 @@ class _ArtistViewState extends State<ArtistView> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
HeroBanner(
cacheKey: widget.artist.coverArtId,
imageUrl: widget.artist.coverArtUrl,
imageUrl: widget.artist.coverArt,
title: widget.artist.name,
description: "This could be a cool description soon",
heroTag: widget.artist.name,
@ -70,7 +69,6 @@ class _ArtistViewState extends State<ArtistView> {
);
},
child: ImageCover(
cacheKey: _albums[n].coverArtId,
imageUrl: _albums[n].coverArtUrl,
title: _albums[n].name,
heroTag: _albums[n].name,

View file

@ -118,8 +118,7 @@ class _HomeViewState extends State<HomeView> {
);
},
child: ImageCover(
cacheKey: index.artists[n].coverArtId,
imageUrl: index.artists[n].coverArtUrl,
imageUrl: index.artists[n].coverArt,
title: index.artists[n].name,
heroTag: index.artists[n].name,
),

View file

@ -11,14 +11,12 @@ class HeroBanner extends StatelessWidget {
required this.title,
required this.description,
this.heroTag = "NotAHero",
this.cacheKey,
super.key,
});
final String imageUrl;
final String title;
final String description;
final String heroTag;
final String? cacheKey;
@override
Widget build(BuildContext context) {
return SizedBox(
@ -33,7 +31,6 @@ class HeroBanner extends StatelessWidget {
tag: heroTag,
child: CachedNetworkImage(
imageUrl: imageUrl,
cacheKey: cacheKey,
placeholder: (c, d) => Shimmer.fromColors(
baseColor: Colors.grey.shade300,
highlightColor: Colors.grey.shade100,

View file

@ -9,7 +9,6 @@ class ImageCover extends StatelessWidget {
required this.imageUrl,
required this.title,
this.heroTag = "VeryUnconspicous",
this.cacheKey,
super.key,
});
@ -17,7 +16,6 @@ class ImageCover extends StatelessWidget {
final String title;
final double _width = 180;
final String heroTag;
final String? cacheKey;
@override
Widget build(BuildContext context) {
return Column(
@ -30,7 +28,6 @@ class ImageCover extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
cacheKey: cacheKey,
imageUrl: imageUrl,
placeholder: (c, d) => Shimmer.fromColors(
baseColor: Colors.grey.shade300,

View file

@ -1,5 +1,8 @@
import 'dart:convert';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:crypto/crypto.dart';
import 'package:flutter/material.dart';
import 'package:ocarina/api/audio/audioplayer_service.dart';
import 'package:ocarina/api/subsonic/song.dart';
@ -98,7 +101,15 @@ class PlayerState extends State<Player> {
),
)
: CachedNetworkImage(
cacheKey: t.coverArtId,
key: Key(
md5
.convert(
utf8.encode(
t.coverArtUrl,
),
)
.toString(),
),
imageUrl: t.coverArtUrl,
placeholder: (c, d) =>
Shimmer.fromColors(
@ -230,7 +241,6 @@ class PlayerState extends State<Player> {
),
)
: (CachedNetworkImage(
cacheKey: AudioPlayerService().song!.coverArtId,
imageUrl:
AudioPlayerService().song!.coverArtUrl,
placeholder: (c, d) => Shimmer.fromColors(

View file

@ -4,15 +4,9 @@ import 'package:flutter/material.dart';
import 'package:text_scroll/text_scroll.dart';
class SongRow extends StatelessWidget {
const SongRow({
required this.imageUrl,
required this.songTitle,
this.cacheKey,
super.key,
});
const SongRow({required this.imageUrl, required this.songTitle, super.key});
final String imageUrl;
final String songTitle;
final String? cacheKey;
@override
Widget build(BuildContext context) {
return ClipRRect(
@ -24,10 +18,7 @@ class SongRow extends StatelessWidget {
height: 100,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: imageUrl,
cacheKey: cacheKey,
),
child: CachedNetworkImage(imageUrl: imageUrl),
),
),
title: AutoSizeText(