Skip to content

Commit

Permalink
Merge pull request #151 from YBTopaz8/DevLastFM
Browse files Browse the repository at this point in the history
Releasing v0.6
  • Loading branch information
YBTopaz8 authored Dec 19, 2024
2 parents 9f418c7 + a637db6 commit 1f15f2f
Show file tree
Hide file tree
Showing 57 changed files with 7,745 additions and 1,079 deletions.
35 changes: 30 additions & 5 deletions Dimmer/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Dimmer_MAUI;

using System.Net;

namespace Dimmer_MAUI;

public partial class App : Application
{
Expand All @@ -9,6 +12,8 @@ public App(DimmerWindow dimmerWindow)
{
InitializeComponent();
SongsManagementService.InitializeParseClient();
SetupLastFM();

}
catch (Exception ex)
{
Expand All @@ -21,25 +26,45 @@ public App(DimmerWindow dimmerWindow)


}


private static void SetupLastFM()
{
AuthData.SetAPIData(APIKeys.LASTFM_API_KEY, APIKeys.LASTFM_API_SECRET);
AuthData.SetUNameAndUPass(APIKeys.USER, APIKeys.PASSWORD);
string localPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);


// Step 1: Define the factory method
Func<string, string, IWebProxy, LastfmClient> factoryMethod = (apiKey, apiSecret, proxy) =>
{
return new LastfmClient(apiKey, apiSecret, proxy); // Replace with your LastfmClient's actual constructor
};

// Step 2: Configure the client
LastfmClient.Configure(factoryMethod, APIKeys.LASTFM_API_KEY, APIKeys.LASTFM_API_SECRET);


}

private void CurrentDomain_FirstChanceException(object? sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
{
Debug.WriteLine($"********** UNHANDLED EXCEPTION! Details: {e.Exception} | {e.Exception.InnerException?.Message} | {e.Exception.Source} " +
$"| {e.Exception.StackTrace} | {e.Exception.Message} || {e.Exception.Data.Values} {e.Exception.HelpLink}");

//var home = IPlatformApplication.Current!.Services.GetService<HomePageVM>();
//await home.ExitingApp();
LogException(e.Exception);
//await home.ExitingApp();LogException(e.Exception);
}

protected override Window CreateWindow(IActivationState? activationState)
{

var vm = IPlatformApplication.Current!.Services.GetService<HomePageVM>();
var vm = IPlatformApplication.Current!.Services.GetService<HomePageVM>()!;
//DimmerWindow.Page.
#if WINDOWS
DimmerWindow.Page = new AppShell(vm);

#elif ANDROID

DimmerWindow.Page = new AppShellMobile();
#endif

Expand Down
5 changes: 3 additions & 2 deletions Dimmer/CustomPopUpViews/SongToPlaylistPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<CollectionView x:Name="PlaylistsCV" HeightRequest="150"
VerticalScrollBarVisibility="Always">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<DataTemplate>

<Border Margin="0,10" StrokeThickness="0.8"
Stroke="Transparent" Padding="0,5"
Expand All @@ -57,7 +57,8 @@
Command="{Binding BindingContext.AddSongToSpecifcPlaylistCommand, Source={x:Reference myPage}}"
CommandParameter="{Binding .}"/>
</Border.GestureRecognizers>
<Label Text="{Binding .}" FontSize="25" TextColor="White"/>
<Label Text="{Binding .}" x:DataType="x:String"
FontSize="25" TextColor="White"/>
</Border>

</DataTemplate>
Expand Down
39 changes: 20 additions & 19 deletions Dimmer/CustomPopUpViews/SortingPopUp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,38 @@
xmlns:syncf="http://schemas.syncfusion.com/maui/toolkit"
Color="Transparent"
>
<Border WidthRequest="500" BackgroundColor="Transparent">
<Border WidthRequest="500" BackgroundColor="#1E1E1E" StrokeShape="RoundRectangle 20">
<VerticalStackLayout BackgroundColor="Transparent" Spacing="15"
Padding="20">
<Label Text="Sort by..." FontSize="Medium" HorizontalTextAlignment="Center"
FontAttributes="Bold" />
<syncf:SfChipGroup ChipType="Choice" Grid.Row="0" BackgroundColor="Transparent"
<syncf:SfChipGroup ChipType="Choice" Grid.Row="0"

ChipClicked="SfChipGroup_ChipClicked" ChipTextColor="White" SelectedChipTextColor="White"
HorizontalOptions="Center" SelectionIndicatorColor="DarkSlateBlue"
>
<syncf:SfChipGroup.ChipLayout>
<VerticalStackLayout Spacing="10" WidthRequest="300"
<VerticalStackLayout Spacing="10" WidthRequest="300"
HorizontalOptions="Start"/>
</syncf:SfChipGroup.ChipLayout>
<syncf:SfChipGroup.Items>

<syncf:SfChip Text="Title - Ascending" CommandParameter="0"/>
<syncf:SfChip Text="Title - Descending" CommandParameter="1"/>
<syncf:SfChip Text="Artist Name - Ascending" CommandParameter="2"/>
<syncf:SfChip Text="Artist Name - Descending" CommandParameter="3"/>
<syncf:SfChip Text="Date Added - Ascending" CommandParameter="4"/>
<syncf:SfChip Text="Date Added - Descending" CommandParameter="5"/>
<syncf:SfChip Text="Duration - Ascending" CommandParameter="6"/>
<syncf:SfChip Text="Duration - Descending" CommandParameter="7"/>
<syncf:SfChip Text="Year - Ascending" CommandParameter="8" />
<syncf:SfChip Text="Year - Descending" CommandParameter="9"/>
<syncf:SfChip Text="Number Of Times Played - Ascending" CommandParameter="10"/>
<syncf:SfChip Text="Number Of Times Played - Descending" CommandParameter="11"/>
<syncf:SfChip Text="Number Of Times Played Completely- Ascending" CommandParameter="12"/>
<syncf:SfChip Text="Number Of Times Played Completely- Descending" CommandParameter="13"/>
<syncf:SfChip Text="Rating - Ascending" CommandParameter="14"/>
<syncf:SfChip Text="Rating - Descending" CommandParameter="15" />
<syncf:SfChip Text="Title - Ascending" CommandParameter="0" TextColor="White"/>
<syncf:SfChip Text="Title - Descending" CommandParameter="1" TextColor="White"/>
<syncf:SfChip Text="Artist Name - Ascending" CommandParameter="2" TextColor="White"/>
<syncf:SfChip Text="Artist Name - Descending" CommandParameter="3" TextColor="White"/>
<syncf:SfChip Text="Date Added - Ascending" CommandParameter="4" TextColor="White"/>
<syncf:SfChip Text="Date Added - Descending" CommandParameter="5" TextColor="White"/>
<syncf:SfChip Text="Duration - Ascending" CommandParameter="6" TextColor="White"/>
<syncf:SfChip Text="Duration - Descending" CommandParameter="7" TextColor="White"/>
<syncf:SfChip Text="Year - Ascending" CommandParameter="8" TextColor="White"/>
<syncf:SfChip Text="Year - Descending" CommandParameter="9" TextColor="White"/>
<!--<syncf:SfChip Text="Number Of Times Played - Ascending" CommandParameter="10" TextColor="White"/>
<syncf:SfChip Text="Number Of Times Played - Descending" CommandParameter="11" TextColor="White"/>
<syncf:SfChip Text="Number Of Times Played Completely- Ascending" CommandParameter="12" TextColor="White"/>
<syncf:SfChip Text="Number Of Times Played Completely- Descending" CommandParameter="13" TextColor="White"/>-->
<syncf:SfChip Text="Rating - Ascending" CommandParameter="14" TextColor="White"/>
<syncf:SfChip Text="Rating - Descending" CommandParameter="15" TextColor="White"/>

</syncf:SfChipGroup.Items>
</syncf:SfChipGroup>
Expand Down
2 changes: 1 addition & 1 deletion Dimmer/CustomPopUpViews/ViewSongMetadataPopupView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<FontImageSource FontFamily="MaterialRounded" Glyph="{x:Static m:MaterialRounded.Update}"/>
</Image.Source>
</Image>
<Label Text="{Binding SelectedSongToOpenBtmSheet.DateAdded, Converter={StaticResource DateTimeOffsetConverter}}"/>
<Label Text="{Binding SelectedSongToOpenBtmSheet.DateCreated, Converter={StaticResource DateTimeOffsetConverter}}"/>
</HorizontalStackLayout>
</VerticalStackLayout>

Expand Down
14 changes: 10 additions & 4 deletions Dimmer/DataAccess/IServices/ISongsManagementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ public interface ISongsManagementService
bool AddArtistsBatch(IEnumerable<ArtistModelView> artists);
Task<bool> LoadSongsFromFolderAsync(List<string> folderPath);//to load songs from folder
void GetSongs();
bool UpdateSongDetails(SongModelView songsModelView);

/// <summary>
/// Adds/Updates a single song to the database.
/// </summary>
/// <param name="SongModelView"></param>
/// <returns></returns>
bool UpdateSongDetails(SongModelView songModelView);
void AddPlayAndCompletionLink(PlayDateAndCompletionStateSongLink link);

void Dispose();
Expand All @@ -30,14 +36,14 @@ public interface ISongsManagementService
ParseUser? CurrentUserOnline { get; internal set; }
IList<PlayDateAndCompletionStateSongLinkView> AllPlayDataAndCompletionStateLinks { get; set; }


Task<UserModelView?> GetUserAccountOnline();
void LogOutUser();
bool IsEmailVerified();
Task<bool> IsEmailVerified();
Task<bool> LoginAndCheckEmailVerificationAsync(string username, string password);

bool RequestPasswordResetAsync(string email);
bool LogUserOnlineAsync(string email, string password);
Task<bool> LogUserOnlineAsync(string email, string password);
bool SignUpUserOnlineAsync(string email, string password);

Task GetAllDataFromOnlineAsync();
Expand Down
Loading

0 comments on commit 1f15f2f

Please sign in to comment.