Netease backend support

This commit is contained in:
2024-09-04 23:28:59 +08:00
parent 010ee6286f
commit 19a7fd82df
19 changed files with 704 additions and 370 deletions

View File

@ -13,7 +13,8 @@ enum CloseBehavior {
enum AudioSource {
youtube,
piped;
piped,
netease;
String get label => name[0].toUpperCase() + name.substring(1);
}
@ -74,6 +75,8 @@ class PreferencesTable extends Table {
text().withDefault(const Constant('')).map(const StringListConverter())();
TextColumn get pipedInstance =>
text().withDefault(const Constant('https://pipedapi.kavin.rocks'))();
TextColumn get neteaseApiInstance => text().withDefault(
const Constant('https://rhythmbox-netease-music-api.vercel.app'))();
TextColumn get themeMode =>
textEnum<ThemeMode>().withDefault(Constant(ThemeMode.system.name))();
TextColumn get audioSource =>
@ -82,8 +85,6 @@ class PreferencesTable extends Table {
textEnum<SourceCodecs>().withDefault(Constant(SourceCodecs.weba.name))();
TextColumn get downloadMusicCodec =>
textEnum<SourceCodecs>().withDefault(Constant(SourceCodecs.m4a.name))();
BoolColumn get discordPresence =>
boolean().withDefault(const Constant(true))();
BoolColumn get endlessPlayback =>
boolean().withDefault(const Constant(true))();
BoolColumn get playerWakelock =>
@ -108,12 +109,12 @@ class PreferencesTable extends Table {
searchMode: SearchMode.youtube,
downloadLocation: '',
localLibraryLocation: [],
neteaseApiInstance: 'https://rhythmbox-netease-music-api.vercel.app',
pipedInstance: 'https://pipedapi.kavin.rocks',
themeMode: ThemeMode.system,
audioSource: AudioSource.youtube,
streamMusicCodec: SourceCodecs.weba,
downloadMusicCodec: SourceCodecs.m4a,
discordPresence: true,
endlessPlayback: true,
playerWakelock: true,
);

View File

@ -2,7 +2,8 @@ part of '../database.dart';
enum SourceType {
youtube._('YouTube'),
youtubeMusic._('YouTube Music');
youtubeMusic._('YouTube Music'),
netease._('Netease Music');
final String label;