Skip to content

Commit

Permalink
code optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacro59 committed Jun 11, 2024
1 parent 3135825 commit 5f721c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
24 changes: 16 additions & 8 deletions source/Models/SteamGridDbSearchResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Playnite.SDK.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -8,16 +9,23 @@ namespace BackgroundChanger.Models
{
public class SteamGridDbSearchResultData
{
public bool success { get; set; }
public List<SteamGridDbSearchResult> data { get; set; }
[SerializationPropertyName("success")]
public bool Success { get; set; }
[SerializationPropertyName("data")]
public List<SteamGridDbSearchResult> Data { get; set; }
}

public class SteamGridDbSearchResult
{
public string name { get; set; }
public long release_date { get; set; }
public bool verified { get; set; }
public int id { get; set; }
public List<string> types { get; set; }
[SerializationPropertyName("name")]
public string Name { get; set; }
[SerializationPropertyName("release_date")]
public long ReleaseDate { get; set; }
[SerializationPropertyName("verified")]
public bool Verified { get; set; }
[SerializationPropertyName("id")]
public int Id { get; set; }
[SerializationPropertyName("types")]
public List<string> Types { get; set; }
}
}
2 changes: 1 addition & 1 deletion source/Services/BackgroundChangerDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override bool LoadDatabase()
}
catch (Exception ex)
{
Common.LogError(ex, false, true, "BackgroundChanger");
Common.LogError(ex, false, true, PluginName);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion source/Views/SteamGridDbView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="PART_ListContener">
<controls2:TextBlockTrimmed Margin="0,2" Text="{Binding name}" MaxWidth="{Binding ElementName=PART_ListContener, Path=ActualWidth}"/>
<controls2:TextBlockTrimmed Margin="0,2" Text="{Binding Name}" MaxWidth="{Binding ElementName=PART_ListContener, Path=ActualWidth}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
Expand Down
4 changes: 2 additions & 2 deletions source/Views/SteamGridDbView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void SearchData(string Name)
{
if (DataSearch != null)
{
PART_SearchList.ItemsSource = DataSearch.data;
PART_SearchList.ItemsSource = DataSearch.Data;
}

PART_DataLoad.Visibility = Visibility.Collapsed;
Expand Down Expand Up @@ -255,7 +255,7 @@ private void PART_SearchList_SelectionChanged(object sender, SelectionChangedEve
{
if (PART_SearchList?.Items?.Count > 0)
{
int Id = ((SteamGridDbSearchResult)PART_SearchList.SelectedItem).id;
int Id = ((SteamGridDbSearchResult)PART_SearchList.SelectedItem).Id;
SearchDataElements(Id);
}
}
Expand Down

0 comments on commit 5f721c5

Please sign in to comment.