Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
itsWindows11 committed Jun 27, 2023
1 parent 9aecf0c commit 5970f4e
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 136 deletions.
28 changes: 0 additions & 28 deletions Rise Media Player Dev/Dialogs/MusixmatchTokenDialog.xaml

This file was deleted.

24 changes: 0 additions & 24 deletions Rise Media Player Dev/Dialogs/MusixmatchTokenDialog.xaml.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Rise Media Player Dev/Dialogs/SetupDialogContent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private async void PrimaryButton_Click(object sender, RoutedEventArgs e)
int progress = ViewModel.SetupProgress;
if (progress == 1)
{
ViewModel.FetchArtistPictures = true;
ViewModel.FetchOnlineData = true;
}
else if (progress == 5)
{
Expand All @@ -58,7 +58,7 @@ private async void SecondaryButton_Click(object sender, RoutedEventArgs e)
}
if (progress == 1)
{
ViewModel.FetchArtistPictures = false;
ViewModel.FetchOnlineData = false;
}
else if (progress == 5)
{
Expand Down
4 changes: 2 additions & 2 deletions Rise Media Player Dev/Helpers/MusixmatchHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Rise.Models;
using System;
using System;
using Rise.Models;
using System.Threading.Tasks;
using Windows.Web.Http;

Expand Down
7 changes: 0 additions & 7 deletions Rise Media Player Dev/Rise.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@
<Compile Include="Dialogs\LibraryPageEditDialog.xaml.cs">
<DependentUpon>LibraryPageEditDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Dialogs\MusixmatchTokenDialog.xaml.cs">
<DependentUpon>MusixmatchTokenDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Dialogs\SetupDialogContent.xaml.cs">
<DependentUpon>SetupDialogContent.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -695,10 +692,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialogs\MusixmatchTokenDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Dialogs\SetupDialogContent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
xmlns:local1="using:Rise.App"
xmlns:markup="using:Rise.Common.Extensions.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="using:Rise.App.UserControls" xmlns:labs="using:CommunityToolkit.Labs.WinUI"
mc:Ignorable="d">

<StackPanel
Expand All @@ -15,49 +16,37 @@
Spacing="4">
<labs:SettingsCard
x:Name="GotoManage"
Click="GotoManage_Click"
Description="{markup:ResourceHelper Name=/Settings/MediaLibraryManageFoldersDesc}"
Header="{markup:ResourceHelper Name=/Settings/MediaLibraryManageFoldersTitle}"
Description="{markup:ResourceHelper Name=/Settings/MediaLibraryManageFoldersDesc}"
Click="GotoManage_Click"
HeaderIcon="{ui:FontIcon Glyph=&#xE8B7;}"
IsClickEnabled="True" />

<TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Text="{markup:ResourceHelper Name=/Settings/MediaLibraryLocalMediaH}" />

<labs:SettingsCard
Header="{markup:ResourceHelper Name=/Settings/MediaLibraryDeletionTitle}"
HeaderIcon="{ui:FontIcon Glyph=&#xE74D;}"
IsEnabled="False">
IsEnabled="False"
HeaderIcon="{ui:FontIcon Glyph=&#xE74D;}">
<ComboBox
ItemsSource="{x:Bind Deletion}"
PlaceholderText="Delete from device"
SelectedIndex="{x:Bind ViewModel.Deletion, Mode=TwoWay}" />
</labs:SettingsCard>

<labs:SettingsCard
Description="{markup:ResourceHelper Name=/Settings/MediaLibraryRippingDesc}"
Header="{markup:ResourceHelper Name=/Settings/MediaLibraryRippingTitle}"
Description="{markup:ResourceHelper Name=/Settings/MediaLibraryRippingDesc}"
IsEnabled="False"
HeaderIcon="{ui:FontIcon Glyph=&#xE958;}"
IsClickEnabled="True"
IsEnabled="False" />
IsClickEnabled="True" />

<TextBlock Style="{StaticResource SubheaderTextBlockStyle}" Text="{markup:ResourceHelper Name=/Settings/MediaLibraryOnlineDataH}" />

<labs:SettingsExpander
x:Name="FetchOnline"
<labs:SettingsCard
Header="{markup:ResourceHelper Name=/Settings/MediaLibraryFetchOnlineData}"
HeaderIcon="{ui:FontIcon Glyph=&#xE774;}">
<labs:SettingsExpander.Items>
<labs:SettingsCard Header="{markup:ResourceHelper Name=/Settings/MediaLibraryFetchArtistPics}">
<ToggleSwitch IsOn="{x:Bind ViewModel.FetchArtistPictures, Mode=TwoWay}" />
</labs:SettingsCard>

<labs:SettingsCard Header="{markup:ResourceHelper Name=/Settings/MediaLibraryFetchLyrics}">
<Button
Click="SetupLyrics_Click"
Content="{markup:ResourceHelper Name=/Settings/MediaLibrarySetupLyrics}"
Style="{StaticResource AccentButtonStyle}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
HeaderIcon="{ui:FontIcon Glyph=&#xE12B;}">
<ToggleSwitch IsOn="{x:Bind local1:App.SViewModel.FetchOnlineData, Mode=TwoWay}" />
</labs:SettingsCard>
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Rise.App.Dialogs;
using Rise.App.ViewModels;
using Rise.App.ViewModels;
using Rise.Common.Extensions.Markup;
using System;
using System.Collections.Generic;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
Expand Down Expand Up @@ -29,10 +27,5 @@ private void GotoManage_Click(object sender, RoutedEventArgs e)
AllSettingsPage.Current.MainSettingsHeaderIcon.Glyph = "\uE838";
AllSettingsPage.Current.SettingsMainFrame.Navigate(typeof(MediaSourcesPage));
}

private async void SetupLyrics_Click(object sender, RoutedEventArgs e)
{
_ = await new MusixmatchTokenDialog().ShowAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,12 @@ public AlbumViewMode AlbumViewMode
#endregion

#region Media Library
public bool FetchArtistPictures
public bool FetchOnlineData
{
get => Get(true, "MediaLibrary");
set => Set(value, "MediaLibrary");
}

public string MusixmatchLyricsToken
{
get => Get(string.Empty, "MediaLibrary");
set => Set(value, "MediaLibrary");
}

public int Deletion
{
get => Get(0, "MediaLibrary");
Expand Down
46 changes: 17 additions & 29 deletions Rise Media Player Dev/Strings/en-GB/Settings.resw
Original file line number Diff line number Diff line change
Expand Up @@ -59,46 +59,46 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
Expand Down Expand Up @@ -447,16 +447,4 @@
<data name="WindowsColors" xml:space="preserve">
<value>Windows colours</value>
</data>
<data name="MediaLibraryFetchArtistPics" xml:space="preserve">
<value>Fetch artist pictures</value>
</data>
<data name="MediaLibraryFetchLyrics" xml:space="preserve">
<value>Fetch lyrics</value>
</data>
<data name="MediaLibrarySetupLyrics" xml:space="preserve">
<value>Setup API token</value>
</data>
<data name="MediaLibrarySetupLyricsToken" xml:space="preserve">
<value>Get an API token</value>
</data>
</root>
2 changes: 1 addition & 1 deletion Rise Media Player Dev/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ await Task.WhenAll(
await Repository.UpsertQueuedAsync();
await Repository.DeleteQueuedAsync();

if (App.SViewModel.FetchArtistPictures)
if (App.SViewModel.FetchOnlineData)
{
MetadataFetchingStarted?.Invoke(this, EventArgs.Empty);
await FetchArtistsArtAsync(token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private async void OnPageLoaded(object sender, RoutedEventArgs e)
ArtistDuration.Text = await Task.Run(() => TimeSpanToString.GetShortFormat(TimeSpan.FromSeconds(MediaViewModel.Items.Cast<SongViewModel>().Select(s => s.Length).Aggregate((t, t1) => t + t1).TotalSeconds)));

string name = SelectedArtist.Name;
if (!SViewModel.FetchArtistPictures ||
if (!SViewModel.FetchOnlineData ||
!WebHelpers.IsInternetAccessAvailable() ||
name == ResourceHelper.GetString("UnknownArtistResource"))
{
Expand Down
2 changes: 1 addition & 1 deletion Rise Media Player Dev/Windows/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private async void OnPageLoaded(object sender, RoutedEventArgs args)
else
{
// Only run the neccessary steps for startup - change tracking & artist image fetching.
if (SViewModel.FetchArtistPictures)
if (SViewModel.FetchOnlineData)
{
await Task.Delay(300);

Expand Down
2 changes: 1 addition & 1 deletion Rise Media Player Dev/Windows/NowPlayingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private void ToggleFullScreen()

private async void OnLyricsListLoaded(object sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(SViewModel.MusixmatchLyricsToken))
if (!SViewModel.FetchOnlineData)
{
_ = VisualStateManager.GoToState(this, "LyricsUnavailableState", true);
return;
Expand Down

0 comments on commit 5970f4e

Please sign in to comment.