mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
fix(web): not building due to metadata_god ffi
chore: update metadata_god and remove win32v3 override
This commit is contained in:
parent
7371cccba6
commit
1191bf232d
1
.gitignore
vendored
1
.gitignore
vendored
@ -32,7 +32,6 @@
|
|||||||
/build/
|
/build/
|
||||||
|
|
||||||
# Web related
|
# Web related
|
||||||
lib/generated_plugin_registrant.dart
|
|
||||||
|
|
||||||
# Symbolication related
|
# Symbolication related
|
||||||
app.*.symbols
|
app.*.symbols
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:metadata_god/metadata_god.dart';
|
import 'package:metadata_god/metadata_god.dart';
|
||||||
@ -35,6 +36,7 @@ const imgMimeToExt = {
|
|||||||
|
|
||||||
final localTracksProvider = FutureProvider<List<Track>>((ref) async {
|
final localTracksProvider = FutureProvider<List<Track>>((ref) async {
|
||||||
try {
|
try {
|
||||||
|
if (kIsWeb) return [];
|
||||||
final downloadLocation = ref.watch(
|
final downloadLocation = ref.watch(
|
||||||
userPreferencesProvider.select((s) => s.downloadLocation),
|
userPreferencesProvider.select((s) => s.downloadLocation),
|
||||||
);
|
);
|
||||||
@ -53,7 +55,7 @@ final localTracksProvider = FutureProvider<List<Track>>((ref) async {
|
|||||||
}).map(
|
}).map(
|
||||||
(f) async {
|
(f) async {
|
||||||
try {
|
try {
|
||||||
final metadata = await MetadataGod.getMetadata(f);
|
final metadata = await MetadataGod.getMetadata(f.path);
|
||||||
|
|
||||||
final imageFile = File(join(
|
final imageFile = File(join(
|
||||||
(await getTemporaryDirectory()).path,
|
(await getTemporaryDirectory()).path,
|
||||||
@ -203,6 +205,5 @@ class UserLocalTracks extends HookConsumerWidget {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ class UniversalImage extends HookWidget {
|
|||||||
placeholder: placeholder,
|
placeholder: placeholder,
|
||||||
cacheKey: path,
|
cacheKey: path,
|
||||||
);
|
);
|
||||||
} else if (Uri.tryParse(path) != null) {
|
} else if (Uri.tryParse(path) != null && !path.startsWith("assets")) {
|
||||||
return Image.file(
|
return Image.file(
|
||||||
File(path),
|
File(path),
|
||||||
width: width,
|
width: width,
|
||||||
@ -74,7 +74,28 @@ class UniversalImage extends HookWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else if (path.startsWith("assets")) {
|
||||||
|
return Image.asset(
|
||||||
|
path,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
cacheHeight: height?.toInt(),
|
||||||
|
cacheWidth: width?.toInt(),
|
||||||
|
scale: scale,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return placeholder?.call(context, error.toString()) ??
|
||||||
|
Image.asset(
|
||||||
|
"assets/placeholder.png",
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
cacheHeight: height?.toInt(),
|
||||||
|
cacheWidth: width?.toInt(),
|
||||||
|
scale: scale,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Image.memory(
|
return Image.memory(
|
||||||
base64Decode(path),
|
base64Decode(path),
|
||||||
width: width,
|
width: width,
|
||||||
|
@ -19,6 +19,7 @@ class _SpotubeLogger extends Logger {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void log(Level level, message, [error, StackTrace? stackTrace]) {
|
void log(Level level, message, [error, StackTrace? stackTrace]) {
|
||||||
|
if (!kIsWeb) {
|
||||||
(kIsAndroid
|
(kIsAndroid
|
||||||
? getExternalStorageDirectory()
|
? getExternalStorageDirectory()
|
||||||
: getApplicationDocumentsDirectory())
|
: getApplicationDocumentsDirectory())
|
||||||
@ -29,6 +30,7 @@ class _SpotubeLogger extends Logger {
|
|||||||
mode: FileMode.writeOnlyAppend);
|
mode: FileMode.writeOnlyAppend);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
super.log(level, "[$owner] $message", error, stackTrace);
|
super.log(level, "[$owner] $message", error, stackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart' hide Image;
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:metadata_god/metadata_god.dart';
|
import 'package:metadata_god/metadata_god.dart';
|
||||||
@ -42,6 +42,7 @@ class Downloader with ChangeNotifier {
|
|||||||
Playback get _playback => ref.read(playbackProvider);
|
Playback get _playback => ref.read(playbackProvider);
|
||||||
|
|
||||||
void addToQueue(Track baseTrack) async {
|
void addToQueue(Track baseTrack) async {
|
||||||
|
if (kIsWeb) return;
|
||||||
if (inQueue.any((t) => t.id == baseTrack.id!)) return;
|
if (inQueue.any((t) => t.id == baseTrack.id!)) return;
|
||||||
inQueue.add(baseTrack);
|
inQueue.add(baseTrack);
|
||||||
currentlyRunning++;
|
currentlyRunning++;
|
||||||
@ -103,7 +104,7 @@ class Downloader with ChangeNotifier {
|
|||||||
final response = await get(Uri.parse(imageUri));
|
final response = await get(Uri.parse(imageUri));
|
||||||
|
|
||||||
await MetadataGod.writeMetadata(
|
await MetadataGod.writeMetadata(
|
||||||
file,
|
file.path,
|
||||||
Metadata(
|
Metadata(
|
||||||
title: track.name,
|
title: track.name,
|
||||||
artist: track.artists?.map((a) => a.name).join(", "),
|
artist: track.artists?.map((a) => a.name).join(", "),
|
||||||
|
16
pubspec.lock
16
pubspec.lock
@ -426,12 +426,10 @@ packages:
|
|||||||
file_picker:
|
file_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "."
|
name: file_picker
|
||||||
ref: HEAD
|
url: "https://pub.dartlang.org"
|
||||||
resolved-ref: f9133f6d5dbf33191fc9b58655aebfd15445045a
|
source: hosted
|
||||||
url: "https://github.com/KRTirtho/flutter_file_picker.git"
|
version: "5.2.0"
|
||||||
source: git
|
|
||||||
version: "5.0.1"
|
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -726,7 +724,7 @@ packages:
|
|||||||
name: metadata_god
|
name: metadata_god
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.1"
|
version: "0.2.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -796,7 +794,7 @@ packages:
|
|||||||
name: package_info_plus_windows
|
name: package_info_plus_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.0"
|
||||||
palette_generator:
|
palette_generator:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1279,7 +1277,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.0"
|
||||||
win32:
|
win32:
|
||||||
dependency: "direct overridden"
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
|
12
pubspec.yaml
12
pubspec.yaml
@ -47,21 +47,13 @@ dependencies:
|
|||||||
path: packages/audioplayers/
|
path: packages/audioplayers/
|
||||||
introduction_screen: ^3.0.2
|
introduction_screen: ^3.0.2
|
||||||
audio_session: ^0.1.10
|
audio_session: ^0.1.10
|
||||||
# This is temporary until the win32v3 update PR is merged and released
|
file_picker: ^5.2.0
|
||||||
file_picker:
|
|
||||||
git:
|
|
||||||
url: https://github.com/KRTirtho/flutter_file_picker.git
|
|
||||||
popover: ^0.2.6+3
|
popover: ^0.2.6+3
|
||||||
queue: ^3.1.0+1
|
queue: ^3.1.0+1
|
||||||
auto_size_text: ^3.0.0
|
auto_size_text: ^3.0.0
|
||||||
badges: ^2.0.3
|
badges: ^2.0.3
|
||||||
mime: ^1.0.2
|
mime: ^1.0.2
|
||||||
metadata_god: ^0.1.1
|
metadata_god: ^0.2.0
|
||||||
|
|
||||||
# Temporary before [package_info_plus_windows] is updated to support
|
|
||||||
# win32v3
|
|
||||||
dependency_overrides:
|
|
||||||
win32: 3.0.0
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Loading…
Reference in New Issue
Block a user