Skip to content

Commit

Permalink
Revert "Improve the process of inserting changes into the database" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
YourOrdinaryCat authored Mar 4, 2022
1 parent 14e209c commit fbbc598
Show file tree
Hide file tree
Showing 38 changed files with 555 additions and 1,013 deletions.
44 changes: 0 additions & 44 deletions Rise Media Player Dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rise.Models", "Rise.Models\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rise.Repository", "Rise.Repository\Rise.Repository.csproj", "{C0DA58A4-4EBE-4F14-8EB2-F92E99960C52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rise.Tasks", "Rise.Tasks\Rise.Tasks.csproj", "{1AC2B1A4-6E0F-4849-A301-7C646A212A24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rise.Data", "Rise.Data\Rise.Data.csproj", "{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -97,46 +93,6 @@ Global
{C0DA58A4-4EBE-4F14-8EB2-F92E99960C52}.Release|x64.Build.0 = Release|x64
{C0DA58A4-4EBE-4F14-8EB2-F92E99960C52}.Release|x86.ActiveCfg = Release|x86
{C0DA58A4-4EBE-4F14-8EB2-F92E99960C52}.Release|x86.Build.0 = Release|x86
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|ARM.ActiveCfg = Debug|ARM
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|ARM.Build.0 = Debug|ARM
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|ARM64.ActiveCfg = Debug|ARM64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|ARM64.Build.0 = Debug|ARM64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|x64.ActiveCfg = Debug|x64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|x64.Build.0 = Debug|x64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|x86.ActiveCfg = Debug|x86
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Debug|x86.Build.0 = Debug|x86
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|Any CPU.Build.0 = Release|Any CPU
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|ARM.ActiveCfg = Release|ARM
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|ARM.Build.0 = Release|ARM
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|ARM64.ActiveCfg = Release|ARM64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|ARM64.Build.0 = Release|ARM64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|x64.ActiveCfg = Release|x64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|x64.Build.0 = Release|x64
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|x86.ActiveCfg = Release|x86
{1AC2B1A4-6E0F-4849-A301-7C646A212A24}.Release|x86.Build.0 = Release|x86
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|ARM.ActiveCfg = Debug|ARM
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|ARM.Build.0 = Debug|ARM
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|ARM64.ActiveCfg = Debug|ARM64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|ARM64.Build.0 = Debug|ARM64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|x64.ActiveCfg = Debug|x64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|x64.Build.0 = Debug|x64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|x86.ActiveCfg = Debug|x86
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Debug|x86.Build.0 = Debug|x86
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|Any CPU.Build.0 = Release|Any CPU
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|ARM.ActiveCfg = Release|ARM
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|ARM.Build.0 = Release|ARM
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|ARM64.ActiveCfg = Release|ARM64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|ARM64.Build.0 = Release|ARM64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|x64.ActiveCfg = Release|x64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|x64.Build.0 = Release|x64
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|x86.ActiveCfg = Release|x86
{5185BB21-8B6A-4C08-8C50-4E1B8F57B2D5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 13 additions & 6 deletions Rise Media Player Dev/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public static TimeSpan IndexingInterval
/// </summary>
public static LastFMViewModel LMViewModel { get; private set; }

/// <summary>
/// Pipeline for interacting with backend service or database.
/// </summary>
public static IRepository Repository { get; private set; }

/// <summary>
/// Gets the music library.
/// </summary>
Expand Down Expand Up @@ -178,7 +183,6 @@ protected async override void OnActivated(IActivatedEventArgs e)

Window.Current.Activate();
break;

case ActivationKind.ToastNotification:
if (e is ToastNotificationActivatedEventArgs toastActivationArgs)
{
Expand All @@ -202,19 +206,22 @@ protected async override void OnActivated(IActivatedEventArgs e)
}

/// <summary>
/// Initializes the app's ViewModels.
/// Initializes the app's database and ViewModels.
/// </summary>
private async Task InitDataSourcesAsync()
private async Task InitDatabase()
{
// We still have to make sure the file's there
_ = await ApplicationData.Current.LocalCacheFolder.CreateFileAsync("Files.db", CreationCollisionOption.OpenIfExists);
string dbPath = Path.Combine(ApplicationData.Current.LocalCacheFolder.Path, "Files.db");
DbContextOptionsBuilder<Context> dbOptions = new DbContextOptionsBuilder<Context>().UseSqlite(
"Data Source=" + dbPath);

Repository = new SQLRepository(dbOptions);

MusicLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Music);
VideoLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Videos);

PBackendController = new PlaylistsBackendController();
NBackendController = new NotificationsBackendController();

MViewModel = new MainViewModel();
LMViewModel = new LastFMViewModel();
PViewModel = new PlaybackViewModel();
Expand Down Expand Up @@ -344,7 +351,7 @@ private async Task<Frame> InitializeWindowAsync(dynamic args)
// just ensure that the window is active
if (Window.Current.Content is not Frame rootFrame)
{
await InitDataSourcesAsync();
await InitDatabase();
await MViewModel.GetListsAsync();

StartIndexingTimer();
Expand Down
2 changes: 1 addition & 1 deletion Rise Media Player Dev/ChangeTrackers/SongsTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static async Task ManageSongChange(StorageLibraryChange change)
if (change.PreviousPath == ViewModel.Songs[i].Location)
{
ViewModel.Songs[i].Location = file.Path;
await ViewModel.Songs[i].SaveEditsAsync();
await ViewModel.Songs[i].SaveAsync();
}
}
break;
Expand Down
44 changes: 22 additions & 22 deletions Rise Media Player Dev/Rise.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@
<Content Include="Assets\Web\LASTFM.png" />
<Content Include="Materials_Visualisers\Bloom.html" />
<Content Include="Properties\Default.rd.xml" />
<PRIResource Include="Strings\en-GB\WindowsBehaviours.resw" />
<PRIResource Include="Strings\en-GB\Widgets.resw" />
<PRIResource Include="Strings\en-GB\HelpTips.resw" />
<PRIResource Include="Strings\en-gb\WindowsBehaviours.resw" />
<PRIResource Include="Strings\en-gb\Widgets.resw" />
<PRIResource Include="Strings\en-gb\HelpTips.resw" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
Expand Down Expand Up @@ -940,14 +940,14 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-GB\Language.resw" />
<PRIResource Include="Strings\en-GB\About.resw" />
<PRIResource Include="Strings\en-GB\Playback.resw" />
<PRIResource Include="Strings\en-GB\Navigation.resw" />
<PRIResource Include="Strings\en-GB\Appearance.resw" />
<PRIResource Include="Strings\en-GB\MediaLibrary.resw" />
<PRIResource Include="Strings\en-GB\Information.resw" />
<PRIResource Include="Strings\en-GB\Sidebar.resw" />
<PRIResource Include="Strings\en-gb\Language.resw" />
<PRIResource Include="Strings\en-gb\About.resw" />
<PRIResource Include="Strings\en-gb\Playback.resw" />
<PRIResource Include="Strings\en-gb\Navigation.resw" />
<PRIResource Include="Strings\en-gb\Appearance.resw" />
<PRIResource Include="Strings\en-gb\MediaLibrary.resw" />
<PRIResource Include="Strings\en-gb\Information.resw" />
<PRIResource Include="Strings\en-gb\Sidebar.resw" />
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\AtAGlance\WidgetService\" />
Expand All @@ -961,13 +961,13 @@
<Folder Include="Settings\SyncingPages\" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-GB\Setup.resw" />
<PRIResource Include="Strings\en-gb\Setup.resw" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-GB\Terms.resw" />
<PRIResource Include="Strings\en-gb\Terms.resw" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-GB\Connect.resw" />
<PRIResource Include="Strings\en-gb\Connect.resw" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\MediaPlayerIcons.ttf">
Expand Down Expand Up @@ -1077,14 +1077,14 @@
<PRIResource Include="Strings\hi-IN\Connect.resw" />
<PRIResource Include="Strings\hi-IN\Appearance.resw" />
<PRIResource Include="Strings\hi-IN\About.resw" />
<PRIResource Include="Strings\en-GB\MediaData.resw" />
<PRIResource Include="Strings\en-GB\NowPlaying.resw" />
<PRIResource Include="Strings\en-GB\File.resw" />
<PRIResource Include="Strings\en-GB\Details.resw" />
<PRIResource Include="Strings\en-GB\Props.resw" />
<PRIResource Include="Strings\en-GB\Finish.resw" />
<PRIResource Include="Strings\en-GB\Privacy.resw" />
<PRIResource Include="Strings\en-GB\Local.resw" />
<PRIResource Include="Strings\en-gb\MediaData.resw" />
<PRIResource Include="Strings\en-gb\NowPlaying.resw" />
<PRIResource Include="Strings\en-gb\File.resw" />
<PRIResource Include="Strings\en-gb\Details.resw" />
<PRIResource Include="Strings\en-gb\Props.resw" />
<PRIResource Include="Strings\en-gb\Finish.resw" />
<PRIResource Include="Strings\en-gb\Privacy.resw" />
<PRIResource Include="Strings\en-gb\Local.resw" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Rise.Models\Rise.Models.csproj">
Expand Down
2 changes: 1 addition & 1 deletion Rise Media Player Dev/UserControls/NowPlayingBar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ private async void Props_Click(object sender, RoutedEventArgs e)
if (!App.PViewModel.CurrentSong.IsOnline)
{
SelectedSong = App.PViewModel.CurrentSong;
await App.PViewModel.CurrentSong.StartEditAsync();
await App.PViewModel.CurrentSong.StartEdit();
}
}

Expand Down
Loading

0 comments on commit fbbc598

Please sign in to comment.