fix: alternative source doesn't persist on next restart #840

This commit is contained in:
Kingkor Roy Tirtho 2024-01-27 20:59:50 +06:00
parent 14d8ea582c
commit 62fde50442
6 changed files with 49 additions and 1 deletions

View File

@ -182,6 +182,9 @@ class Sidebar extends HookConsumerWidget {
), ),
itemTextPadding: const EdgeInsets.only(left: 10), itemTextPadding: const EdgeInsets.only(left: 10),
selectedItemTextPadding: const EdgeInsets.only(left: 10), selectedItemTextPadding: const EdgeInsets.only(left: 10),
hoverTextStyle: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.primary,
),
), ),
), ),
), ),

View File

@ -185,6 +185,16 @@ class JioSaavnSourcedTrack extends SourcedTrack {
final (:info, :source) = toSiblingType(item); final (:info, :source) = toSiblingType(item);
await SourceMatch.box.put(
id!,
SourceMatch(
id: id!,
sourceType: SourceType.jiosaavn,
createdAt: DateTime.now(),
sourceId: info.id,
),
);
return JioSaavnSourcedTrack( return JioSaavnSourcedTrack(
ref: ref, ref: ref,
siblings: newSiblings, siblings: newSiblings,

View File

@ -263,6 +263,16 @@ class PipedSourcedTrack extends SourcedTrack {
final manifest = await pipedClient.streams(newSourceInfo.id); final manifest = await pipedClient.streams(newSourceInfo.id);
await SourceMatch.box.put(
id!,
SourceMatch(
id: id!,
sourceType: SourceType.jiosaavn,
createdAt: DateTime.now(),
sourceId: newSourceInfo.id,
),
);
return PipedSourcedTrack( return PipedSourcedTrack(
ref: ref, ref: ref,
siblings: newSiblings, siblings: newSiblings,

View File

@ -246,6 +246,16 @@ class YoutubeSourcedTrack extends SourcedTrack {
final manifest = final manifest =
await youtubeClient.videos.streamsClient.getManifest(newSourceInfo.id); await youtubeClient.videos.streamsClient.getManifest(newSourceInfo.id);
await SourceMatch.box.put(
id!,
SourceMatch(
id: id!,
sourceType: SourceType.jiosaavn,
createdAt: DateTime.now(),
sourceId: newSourceInfo.id,
),
);
return YoutubeSourcedTrack( return YoutubeSourcedTrack(
ref: ref, ref: ref,
siblings: newSiblings, siblings: newSiblings,

View File

@ -228,7 +228,7 @@
}; };
}; };
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3"; compatibilityVersion = "Xcode 12.0";
developmentRegion = en; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
@ -427,7 +427,10 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 88NVGSJ5N3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Spotube;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
@ -554,7 +557,10 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 88NVGSJ5N3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Spotube;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
@ -575,7 +581,10 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 88NVGSJ5N3;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Spotube;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.music";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/../Frameworks", "@executable_path/../Frameworks",

View File

@ -4,8 +4,14 @@
<dict> <dict>
<key>com.apple.security.app-sandbox</key> <key>com.apple.security.app-sandbox</key>
<true/> <true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
<key>com.apple.security.cs.allow-jit</key> <key>com.apple.security.cs.allow-jit</key>
<true/> <true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key> <key>com.apple.security.network.client</key>
<true/> <true/>
<key>com.apple.security.network.server</key> <key>com.apple.security.network.server</key>