├── .github └── FUNDING.yml ├── CommonPluginsShared ├── Resources │ └── font.ttf ├── Interfaces │ ├── IDataContext.cs │ ├── IPluginSettings.cs │ └── IPluginDatabase.cs ├── Collections │ └── PluginDataBaseGameDetails.cs ├── Models │ ├── SourceLink.cs │ ├── Folder.cs │ ├── PluginPaths.cs │ ├── DataGame.cs │ ├── CheckElement.cs │ └── TraceInfos.cs ├── CommonPluginsShared.sln ├── Converters │ ├── EnumToBooleanConverter.cs │ ├── HeightToFontSizeConverter.cs │ ├── ValueOperationConverter.cs │ ├── TwoBooleanToVisibilityConverter.cs │ ├── ImageToGrayConverter.cs │ ├── GetImageConverter.cs │ ├── StringRemoveConverter.cs │ ├── ListMoreOneBoolConverter.cs │ ├── IndexConverter.cs │ ├── StringToBooleanConverter.cs │ ├── LocalTimeConverter.cs │ ├── LocalDateConverter.cs │ ├── LocalDateTimeConverter.cs │ ├── VisibilityZeroConverter.cs │ ├── DockToStringConverter.cs │ └── GetMediaTypeConverter.cs ├── CumulsErrors.cs ├── Plugins │ ├── PluginMenu.cs │ └── PluginElement.cs ├── Paths.cs ├── CommonPluginsShared.shproj └── Commands.cs ├── CommonPluginsResources ├── Resources │ ├── font.ttf │ ├── akr.WPF.Controls.ColorPicker.dll │ ├── Common.xaml │ ├── LiveChartsCommon │ │ └── Common.xaml │ └── Controls │ │ └── ListExtendStyle.xaml ├── ResourcesPlaynite │ ├── icofont.ttf │ ├── DerivedStyles │ │ ├── BottomButton.xaml │ │ └── HighlightBorder.xaml │ ├── DefaultControls │ │ ├── Border.xaml │ │ ├── GridSplitter.xaml │ │ ├── Popup.xaml │ │ ├── TextBlock.xaml │ │ ├── ToolTip.xaml │ │ ├── Label.xaml │ │ ├── Hyperlink.xaml │ │ └── ContextMenu.xaml │ ├── AmazonLocSource.xaml │ ├── OriginLocSource.xaml │ ├── UplayLocSource.xaml │ ├── Common.xaml │ ├── RockstarLibrary.xaml │ └── BattleNetLocSource.xaml └── Properties │ └── AssemblyInfo.cs ├── crowdin.yml ├── App.config ├── .coderabbit.yaml ├── CommonPluginsStores ├── Epic │ └── Models │ │ ├── AgeGatings.cs │ │ ├── Category.cs │ │ ├── CustomAttribute.cs │ │ ├── Response │ │ ├── CatalogNamespaceResponse.cs │ │ ├── CatalogOfferResponse.cs │ │ ├── PlaytimeItem.cs │ │ └── LibraryItemsResponse.cs │ │ ├── Mappings.cs │ │ ├── ReleaseInfo.cs │ │ ├── CatalogNs.cs │ │ ├── Catalog.cs │ │ ├── KeyImage.cs │ │ ├── Query │ │ ├── QueryPlayerAchievement.cs │ │ └── QueryGetCatalogMappings.cs │ │ ├── Mapping.cs │ │ └── Asset.cs ├── Gog │ └── Models │ │ ├── UserDataOwned.cs │ │ ├── PriceData.cs │ │ ├── WishlistResult.cs │ │ ├── Common.cs │ │ ├── PriceResult.cs │ │ ├── ProfileGames.cs │ │ └── AccountBasicResponse.cs ├── Models │ ├── Enumerations │ │ ├── AccountStatus.cs │ │ └── AuthStatus.cs │ ├── AccountWishlist.cs │ ├── AccountGameInfos.cs │ ├── GameDlcOwned.cs │ ├── StoreToken.cs │ ├── GameInfos.cs │ ├── AchievementProgression.cs │ ├── StoreCurrency.cs │ ├── StoreSettings.cs │ ├── BasicAccountGameInfos.cs │ └── Interfaces │ │ └── IStoreApi.cs ├── Steam │ └── Models │ │ ├── SteamKit │ │ ├── SteamStats.cs │ │ ├── SteamFriend.cs │ │ ├── SteamPlayerAchievement.cs │ │ └── SteamSchema.cs │ │ ├── SteamUser.cs │ │ ├── RgProfileData.cs │ │ ├── SteamFriendsList.cs │ │ ├── ExtensionsAchievements.cs │ │ ├── SteamAppList.cs │ │ ├── SteamAchievementData.cs │ │ ├── SteamGameAchievements.cs │ │ ├── SteamOwnedGames.cs │ │ ├── SteamPlayerSummaries.cs │ │ └── SteamSearch.cs ├── GameJolt │ └── Models │ │ ├── C.cs │ │ ├── AvatarFrame.cs │ │ ├── Compatibility.cs │ │ ├── TrophiesOverwiew.cs │ │ ├── Theme.cs │ │ ├── Sellable.cs │ │ ├── Trophy.cs │ │ ├── SiteTrophy.cs │ │ ├── ProfileTrophiesGame.cs │ │ ├── GameTrophy.cs │ │ └── Ressource.cs ├── Ea │ └── Models │ │ └── Query │ │ ├── QueryIdentity.cs │ │ ├── QueryFriends.cs │ │ ├── QueryRecentGames.cs │ │ ├── ResponseFriends.cs │ │ ├── QueryAchievements.cs │ │ ├── ResponseRecentGames.cs │ │ ├── ResponseAchievements.cs │ │ └── ResponseIdentity.cs ├── Psn │ └── Models │ │ └── PsnApi.cs ├── CommonPluginsStores.shproj └── Uplay │ └── UplayAPI.cs ├── CommonPluginsControls ├── packages.config ├── LiveChartsCommon │ ├── CustomerForSingle.cs │ ├── CustomerForTime.cs │ └── CustomerToolTipForMultipleSingle.xaml.cs ├── Controls │ ├── TextBlockTrimmed.xaml │ └── ComboBoxRemovable.xaml.cs ├── PlayniteControls │ └── SearchBox.xaml ├── Stores │ ├── Steam │ │ └── PanelViewModel.cs │ ├── Gog │ │ └── PanelViewModel.cs │ ├── GameJolt │ │ └── PanelViewModel.cs │ └── Epic │ │ └── PanelViewModel.cs ├── Views │ ├── ListDataUpdated.xaml.cs │ ├── SelectVariable.xaml.cs │ └── ListWithNoData.xaml.cs └── Properties │ └── AssemblyInfo.cs ├── CommonPlayniteShared ├── Native │ ├── Fileapi.cs │ ├── Psapi.cs │ ├── Winbase.cs │ ├── Shlwapi.cs │ ├── Processthreadsapi.cs │ └── Winnt.cs ├── PluginLibrary │ ├── HumbleLibrary │ │ └── Models │ │ │ └── UserHome.cs │ ├── OriginLibrary │ │ └── Models │ │ │ ├── AppsListResponse.cs │ │ │ ├── AuthTokenResponse.cs │ │ │ ├── AccountInfoResponse.cs │ │ │ ├── StorePageMetadata.cs │ │ │ ├── AccountEntitlementsResponse.cs │ │ │ ├── UsageReponse.cs │ │ │ ├── GameStoreDataResponse.cs │ │ │ └── GameLocalDataResponse.cs │ ├── EpicLibrary │ │ └── Models │ │ │ ├── AccountResponse.cs │ │ │ ├── ErrorResponse.cs │ │ │ ├── OauthResponse.cs │ │ │ └── LauncherInstalled.cs │ ├── GogLibrary │ │ └── Models │ │ │ ├── PagedResponse.cs │ │ │ ├── AccountBasicResponse.cs │ │ │ ├── LibraryGameResponse.cs │ │ │ └── ProductApiDetail.cs │ ├── BattleNetLibrary │ │ └── Models │ │ │ └── BattleNetApiStatus.cs │ └── NintendoLibrary │ │ └── Models │ │ └── NintendoModels.cs ├── Common │ ├── Units.cs │ ├── DesignerTools.cs │ ├── Xaml.cs │ ├── GlobalRandom.cs │ ├── Constants.cs │ └── Extensions │ │ ├── ItemsControlExtensions.cs │ │ └── Enums.cs ├── Converters │ ├── NegateConverter.cs │ ├── InvertedBoolenConverter.cs │ ├── TwoBooleanToBooleanConverter.cs │ ├── ObjectToStringConverter.cs │ ├── StringNullOrEmptyToBoolConverter.cs │ └── StringNullOrEmptyToVisibilityConverter.cs ├── CommonPlayniteShared.shproj ├── Extensions │ └── IProvideValueTarget.cs ├── Settings │ └── PlayniteSettings.cs └── Behaviors │ └── MediaElementBehaviors.cs ├── README.md ├── LICENSE └── PluginCommon.csproj /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: lacro59 2 | -------------------------------------------------------------------------------- /CommonPluginsShared/Resources/font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lacro59/playnite-plugincommon/HEAD/CommonPluginsShared/Resources/font.ttf -------------------------------------------------------------------------------- /CommonPluginsResources/Resources/font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lacro59/playnite-plugincommon/HEAD/CommonPluginsResources/Resources/font.ttf -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /CommonPluginsResources/Localization/Common/LocSource.xaml 3 | translation: /%original_path%/%locale_with_underscore%.xaml 4 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/icofont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lacro59/playnite-plugincommon/HEAD/CommonPluginsResources/ResourcesPlaynite/icofont.ttf -------------------------------------------------------------------------------- /CommonPluginsResources/Resources/akr.WPF.Controls.ColorPicker.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lacro59/playnite-plugincommon/HEAD/CommonPluginsResources/Resources/akr.WPF.Controls.ColorPicker.dll -------------------------------------------------------------------------------- /CommonPluginsShared/Interfaces/IDataContext.cs: -------------------------------------------------------------------------------- 1 | namespace CommonPluginsShared.Interfaces 2 | { 3 | public interface IDataContext 4 | { 5 | bool IsActivated { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CommonPluginsResources/Resources/Common.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /.coderabbit.yaml: -------------------------------------------------------------------------------- 1 | # .coderabbit.yaml 2 | reviews: 3 | auto_review: 4 | enabled: true 5 | base_branches: 6 | - "devel" 7 | ignore_title_keywords: 8 | - "l10n" 9 | - "localization" 10 | - "translation" 11 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/AgeGatings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class AgeGatings 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /CommonPluginsShared/Collections/PluginDataBaseGameDetails.cs: -------------------------------------------------------------------------------- 1 | namespace CommonPluginsShared.Collections 2 | { 3 | public abstract class PluginDataBaseGameDetails : PluginDataBaseGame 4 | { 5 | public abstract Y ItemsDetails { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /CommonPluginsControls/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/UserDataOwned.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System.Collections.Generic; 3 | 4 | namespace CommonPluginsStores.Gog.Models 5 | { 6 | public class UserDataOwned 7 | { 8 | [SerializationPropertyName("owned")] 9 | public List Owned { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class Category 8 | { 9 | [SerializationPropertyName("path")] 10 | public string Path { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/Enumerations/AccountStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Models.Enumerations 6 | { 7 | public enum AccountStatus 8 | { 9 | Checking, 10 | Private, 11 | Public, 12 | Unknown 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamKit/SteamStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Steam.Models.SteamKit 6 | { 7 | public class SteamStats 8 | { 9 | public string Name { get; set; } 10 | public string Value { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Fileapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.Native 8 | { 9 | public class Fileapi 10 | { 11 | public const uint FILE_FLAG_BACKUP_SEMANTICS = 0x2000000; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/SourceLink.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Models 6 | { 7 | public class SourceLink 8 | { 9 | public string Name { get; set; } 10 | public string GameName { get; set; } 11 | public string Url { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/HumbleLibrary/Models/UserHome.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.HumbleLibrary.Models 8 | { 9 | public class UserHome 10 | { 11 | public List gamekeys; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/AppsListResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 6 | { 7 | public class AppsListResponse 8 | { 9 | public int totalCount; 10 | public List offers; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/Enumerations/AuthStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Models.Enumerations 6 | { 7 | public enum AuthStatus 8 | { 9 | Ok, 10 | Checking, 11 | AuthRequired, 12 | PrivateAccount, 13 | Failed, 14 | Unknown 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/PriceData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Gog.Models 6 | { 7 | public class PriceData 8 | { 9 | public dynamic DataObj { get; set; } 10 | public string CodeCurrency { get; set; } 11 | public string SymbolCurrency { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPluginsControls/LiveChartsCommon/CustomerForSingle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CommonPluginsControls.LiveChartsCommon 4 | { 5 | public class CustomerForSingle 6 | { 7 | public string Icon { get; set; } 8 | public string IconText { get; set; } 9 | 10 | public string Name { get; set; } 11 | public double Values { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/Folder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Models 6 | { 7 | public class Folder 8 | { 9 | public string FolderPath { get; set; } 10 | 11 | // Specific SteamEmulator 12 | public string GameId { get; set; } 13 | public bool HasGame { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamKit/SteamFriend.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Steam.Models.SteamKit 6 | { 7 | public class SteamFriend 8 | { 9 | public ulong SteamId { get; set; } 10 | public string Relationship { get; set; } 11 | public DateTime FriendSince { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/EpicLibrary/Models/AccountResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.EpicLibrary.Models 8 | { 9 | public class AccountResponse 10 | { 11 | public string id; 12 | public string displayName; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/PluginPaths.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Models 6 | { 7 | public class PluginPaths 8 | { 9 | public string PluginPath { get; set; } 10 | public string PluginUserDataPath { get; set; } 11 | public string PluginDatabasePath { get; set; } 12 | public string PluginCachePath { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/DataGame.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Models 6 | { 7 | public class DataGame 8 | { 9 | public Guid Id { get; set; } 10 | public string Icon { get; set; } 11 | public string Name { get; set; } 12 | 13 | public bool IsDeleted { get; set; } 14 | public ulong CountData { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Steam.Models 6 | { 7 | public class SteamUser 8 | { 9 | public ulong SteamId { get; set; } 10 | public uint AccountId => SteamApi.GetAccountId(SteamId); 11 | public string AccountName { get; set; } 12 | public string PersonaName { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/WishlistResult.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Gog.Models 7 | { 8 | public class WishlistResult 9 | { 10 | [SerializationPropertyName("wishlist")] 11 | public dynamic Wishlist { get; set; } 12 | 13 | [SerializationPropertyName("checksum")] 14 | public string Checksum { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/C.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class C 11 | { 12 | [SerializationPropertyName("eea")] 13 | public bool Eea { get; set; } 14 | 15 | [SerializationPropertyName("ads")] 16 | public bool Ads { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/AuthTokenResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class AuthTokenResponse 10 | { 11 | public string error; 12 | public string expires_in; 13 | public string token_type; 14 | public string access_token; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/CheckElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Models 6 | { 7 | public class CheckElement 8 | { 9 | public Guid Id { get; set; } 10 | public string Icon { get; set; } 11 | public string Name { get; set; } 12 | public string NameShort { get; set; } 13 | public bool IsCheck { get; set; } 14 | public bool IsVisible { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamKit/SteamPlayerAchievement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Steam.Models.SteamKit 6 | { 7 | public class SteamPlayerAchievement 8 | { 9 | public string ApiName { get; set; } 10 | public int Achieved { get; set; } 11 | public DateTime UnlockTime { get; set; } 12 | public string Name { get; set; } 13 | public string Description { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/AvatarFrame.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class AvatarFrame 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("image_url")] 16 | public string ImageUrl { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DerivedStyles/BottomButton.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/EpicLibrary/Models/ErrorResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.EpicLibrary.Models 8 | { 9 | public class ErrorResponse 10 | { 11 | public string errorCode; 12 | public string errorMessage; 13 | public int numericErrorCode; 14 | public string originatingService; 15 | public string intent; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CommonPluginsShared/Interfaces/IPluginSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsShared.Interfaces 6 | { 7 | public interface IPluginSettings 8 | { 9 | bool MenuInExtensions { get; set; } 10 | 11 | bool EnableTag { get; set; } 12 | 13 | #region Automatic update when updating library 14 | DateTime LastAutoLibUpdateAssetsDownload { get; set; } 15 | bool AutoImport { get; set; } 16 | #endregion 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/CustomAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class CustomAttribute 8 | { 9 | [SerializationPropertyName("key")] 10 | public string Key { get; set; } 11 | 12 | [SerializationPropertyName("value")] 13 | public string Value { get; set; } 14 | 15 | [SerializationPropertyName("type")] 16 | public string Type { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Response/CatalogNamespaceResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Playnite.SDK.Data; 3 | 4 | namespace CommonPluginsStores.Epic.Models.Response 5 | { 6 | public class CatalogNamespaceResponse 7 | { 8 | [SerializationPropertyName("data")] 9 | public DataCatalogNamespace Data { get; set; } 10 | } 11 | 12 | public class DataCatalogNamespace 13 | { 14 | [SerializationPropertyName("Catalog")] 15 | public Catalog Catalog { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Response/CatalogOfferResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models.Response 6 | { 7 | public class CatalogOfferResponse 8 | { 9 | [SerializationPropertyName("data")] 10 | public DataCatalogOffer Data { get; set; } 11 | } 12 | 13 | public class DataCatalogOffer 14 | { 15 | [SerializationPropertyName("Catalog")] 16 | public Catalog Catalog { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/AccountInfoResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class AccountInfoResponse 10 | { 11 | public class AcccountInfoData 12 | { 13 | public long pidId; 14 | } 15 | 16 | public string error; 17 | public AcccountInfoData pid; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Mappings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Playnite.SDK.Data; 3 | 4 | namespace CommonPluginsStores.Epic.Models 5 | { 6 | public class Mappings 7 | { 8 | [SerializationPropertyName("cmsSlug")] 9 | public string CmsSlug { get; set; } 10 | 11 | [SerializationPropertyName("offerId")] 12 | public object OfferId { get; set; } 13 | 14 | [SerializationPropertyName("prePurchaseOfferId")] 15 | public object PrePurchaseOfferId { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/Units.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.Common 8 | { 9 | public static class Units 10 | { 11 | public static long MegaBytesToBytes(long megaBytes) 12 | { 13 | return megaBytes * 1024 * 1024; 14 | } 15 | 16 | public static long BytesToMegaBytes(long bytes) 17 | { 18 | return bytes / 1024 / 1024; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Psapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Native 9 | { 10 | public class Psapi 11 | { 12 | private const string dllName = "Psapi.dll"; 13 | 14 | [DllImport(dllName, SetLastError = true, CharSet = CharSet.Unicode)] 15 | public static extern int GetMappedFileName(IntPtr hProcess, IntPtr lpv, StringBuilder lpFilename, int nSize); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Response/PlaytimeItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models.Response 6 | { 7 | public class PlaytimeItem 8 | { 9 | [SerializationPropertyName("accountId")] 10 | public string AccountId { get; set; } 11 | 12 | [SerializationPropertyName("artifactId")] 13 | public string ArtifactId { get; set; } 14 | 15 | [SerializationPropertyName("totalTime")] 16 | public int TotalTime { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/GogLibrary/Models/PagedResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.GogLibrary.Models 8 | { 9 | public class PagedResponse 10 | { 11 | public class Embedded 12 | { 13 | public List items; 14 | } 15 | 16 | public int page; 17 | public int pages; 18 | public int total; 19 | public int limit; 20 | public Embedded _embedded; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CommonPluginsControls/LiveChartsCommon/CustomerForTime.cs: -------------------------------------------------------------------------------- 1 | using CommonPluginsControls.Controls; 2 | using System; 3 | 4 | namespace CommonPluginsControls.LiveChartsCommon 5 | { 6 | public class CustomerForTime 7 | { 8 | public string Icon { get; set; } 9 | public string IconText { get; set; } 10 | 11 | public bool HideIsZero { get; set; } 12 | 13 | public string Name { get; set; } 14 | public long Values { get; set; } 15 | public string ValuesFormat => (int)TimeSpan.FromSeconds(Values).TotalHours + "h " + TimeSpan.FromSeconds(Values).ToString(@"mm") + "min"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/AccountWishlist.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CommonPluginsStores.Models 4 | { 5 | /// 6 | /// Represents a user's game wishlist in an account. 7 | /// Inherits from to include basic game details. 8 | /// 9 | public class AccountWishlist : BasicAccountGameInfos 10 | { 11 | private DateTime? _added; 12 | 13 | /// 14 | /// Gets or sets the date when the game was added to the wishlist. 15 | /// 16 | public DateTime? Added { get => _added; set => _added = value; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/GogLibrary/Models/AccountBasicResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.GogLibrary.Models 8 | { 9 | public class AccountBasicResponse 10 | { 11 | public string accessToken; 12 | public int accessTokenExpires; 13 | public string avatar; 14 | public int cacheExpires; 15 | public string clientId; 16 | public bool isLoggedIn; 17 | public string userId; 18 | public string username; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/ReleaseInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class ReleaseInfo 8 | { 9 | [SerializationPropertyName("id")] 10 | public string Id { get; set; } 11 | 12 | [SerializationPropertyName("appId")] 13 | public string AppId { get; set; } 14 | 15 | [SerializationPropertyName("platform")] 16 | public List Platform { get; set; } 17 | 18 | [SerializationPropertyName("dateAdded")] 19 | public DateTime DateAdded { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/CatalogNs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class CatalogNs 8 | { 9 | [SerializationPropertyName("displayName")] 10 | public string DisplayName { get; set; } 11 | 12 | [SerializationPropertyName("mappings")] 13 | public List Mappings { get; set; } 14 | 15 | [SerializationPropertyName("parent")] 16 | public string Parent { get; set; } 17 | 18 | [SerializationPropertyName("store")] 19 | public string Store { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/AccountGameInfos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace CommonPluginsStores.Models 8 | { 9 | public class AccountGameInfos : BasicAccountGameInfos 10 | { 11 | public bool IsCommun { get; set; } 12 | public int Playtime { get; set; } 13 | 14 | public int AchievementsUnlocked => Achievements?.Where(y => y.DateUnlocked != default)?.Count() ?? 0; 15 | public ObservableCollection Achievements { get; set; } 16 | 17 | public DateTime LastCall => DateTime.Now; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/RgProfileData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Playnite.SDK.Data; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class RgProfileData 9 | { 10 | [SerializationPropertyName("url")] 11 | public string Url { get; set; } 12 | 13 | [SerializationPropertyName("steamid")] 14 | public ulong SteamId { get; set; } 15 | 16 | [SerializationPropertyName("personaname")] 17 | public string PersonaName { get; set; } 18 | 19 | [SerializationPropertyName("summary")] 20 | public string Summary { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Winbase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Native 9 | { 10 | [UnmanagedFunctionPointer(CallingConvention.Winapi, SetLastError = true, CharSet = CharSet.Unicode)] 11 | public delegate bool ENUMRESNAMEPROC(IntPtr hModule, IntPtr lpszType, IntPtr lpszName, IntPtr lParam); 12 | 13 | [StructLayout(LayoutKind.Sequential)] 14 | public struct SECURITY_ATTRIBUTES 15 | { 16 | public int nLength; 17 | public IntPtr lpSecurityDescriptor; 18 | public int bInheritHandle; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/BattleNetLibrary/Models/BattleNetApiStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.BattleNetLibrary.Models 8 | { 9 | public class BattleNetApiStatus 10 | { 11 | public class AccountCompletion 12 | { 13 | public bool requiresHealup; 14 | public string accountCountry; 15 | public string completionUrl; 16 | } 17 | 18 | public AccountCompletion accountCompletion; 19 | public string logoutUri; 20 | public string loginUri; 21 | public bool authenticated; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Catalog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class Catalog 8 | { 9 | [SerializationPropertyName("catalogOffer")] 10 | public CatalogOffer CatalogOffer { get; set; } 11 | 12 | [SerializationPropertyName("catalogOffers")] 13 | public CatalogOffers CatalogOffers { get; set; } 14 | 15 | [SerializationPropertyName("catalogNs")] 16 | public CatalogNs CatalogNs { get; set; } 17 | } 18 | 19 | public class CatalogOffers 20 | { 21 | [SerializationPropertyName("elements")] 22 | public List Elements { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/DesignerTools.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Common 9 | { 10 | public class DesignerTools 11 | { 12 | private static bool? inDesignMode = null; 13 | 14 | public static bool IsInDesignMode 15 | { 16 | get 17 | { 18 | if (inDesignMode == null) 19 | { 20 | inDesignMode = DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject()); 21 | } 22 | 23 | return inDesignMode.Value; 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /CommonPluginsControls/Controls/TextBlockTrimmed.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/Border.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/Common.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Gog.Models 7 | { 8 | public class Links 9 | { 10 | [SerializationPropertyName("self")] 11 | public Ref Self { get; set; } 12 | 13 | [SerializationPropertyName("first")] 14 | public Ref First { get; set; } 15 | 16 | [SerializationPropertyName("last")] 17 | public Ref Last { get; set; } 18 | 19 | [SerializationPropertyName("next")] 20 | public Ref Next { get; set; } 21 | } 22 | 23 | public class Ref 24 | { 25 | [SerializationPropertyName("href")] 26 | public string Href { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/StorePageMetadata.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class StorePageMetadata 10 | { 11 | public class Components 12 | { 13 | public List> items; 14 | } 15 | 16 | public class GameHub 17 | { 18 | public string name; 19 | public string type; 20 | public string locale; 21 | public string country; 22 | public Components components; 23 | } 24 | 25 | public GameHub gamehub; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/GameDlcOwned.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CommonPluginsStores.Models 5 | { 6 | /// 7 | /// Represents a downloadable content (DLC) owned by the user. 8 | /// 9 | public class GameDlcOwned : ObservableObject 10 | { 11 | private string _id; 12 | 13 | /// 14 | /// Gets or sets the unique identifier for the DLC. 15 | /// 16 | public string Id { get => _id; set => _id = value; } 17 | 18 | private string _id2; 19 | 20 | /// 21 | /// Gets or sets the unique identifier for the DLC. 22 | /// 23 | public string Id2 { get => _id2; set => _id2 = value; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/QueryIdentity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Ea.Models.Query 6 | { 7 | public class QueryIdentity 8 | { 9 | public string query = @" 10 | query { 11 | me { 12 | player { 13 | pd 14 | psd 15 | displayName 16 | uniqueName 17 | nickname 18 | avatar { 19 | medium { 20 | path 21 | } 22 | } 23 | } 24 | } 25 | }"; 26 | } 27 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Response/LibraryItemsResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models.Response 6 | { 7 | public class LibraryItemsResponse 8 | { 9 | [SerializationPropertyName("responseMetadata")] 10 | public ResponseMetadata ResponseMetadata { get; set; } = new ResponseMetadata(); 11 | 12 | [SerializationPropertyName("records")] 13 | public List Records { get; set; } 14 | } 15 | 16 | public class ResponseMetadata 17 | { 18 | [SerializationPropertyName("nextCursor")] 19 | public string NextCursor { get; set; } 20 | 21 | [SerializationPropertyName("stateToken")] 22 | public string StateToken { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/GridSplitter.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/GogLibrary/Models/LibraryGameResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.GogLibrary.Models 8 | { 9 | public class LibraryGameResponse 10 | { 11 | public class Game 12 | { 13 | public string id; 14 | public bool achievementSupport; 15 | public string image; 16 | public string title; 17 | public string url; 18 | } 19 | 20 | public class Stats 21 | { 22 | public DateTime? lastSession; 23 | public int playtime; 24 | } 25 | 26 | public Game game; 27 | 28 | public object stats; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPluginsShared/CommonPluginsShared.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.1321 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommonPluginsShared", "CommonPluginsShared.shproj", "{27E5D35B-F3CE-4A3F-9705-4564674615A5}" 7 | EndProject 8 | Global 9 | GlobalSection(SharedMSBuildProjectFiles) = preSolution 10 | CommonPluginsShared.projitems*{27e5d35b-f3ce-4a3f-9705-4564674615a5}*SharedItemsImports = 13 11 | EndGlobalSection 12 | GlobalSection(SolutionProperties) = preSolution 13 | HideSolutionNode = FALSE 14 | EndGlobalSection 15 | GlobalSection(ExtensibilityGlobals) = postSolution 16 | SolutionGuid = {F3146C4F-75B6-4E77-BE2C-6414380B6B6B} 17 | EndGlobalSection 18 | EndGlobal 19 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/Compatibility.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class Compatibility 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("game_id")] 16 | public int GameId { get; set; } 17 | 18 | [SerializationPropertyName("os_windows")] 19 | public bool OsWindows { get; set; } 20 | 21 | [SerializationPropertyName("os_windows_64")] 22 | public bool OsWindows64 { get; set; } 23 | 24 | [SerializationPropertyName("type_html")] 25 | public bool TypeHtml { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/Popup.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/QueryFriends.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Ea.Models.Query 6 | { 7 | public class QueryFriends 8 | { 9 | public string query = @" 10 | query { 11 | me { 12 | friends { 13 | items { 14 | player { 15 | pd 16 | psd 17 | displayName 18 | uniqueName 19 | nickname 20 | avatar { 21 | medium { 22 | path 23 | } 24 | } 25 | } 26 | } 27 | } 28 | } 29 | }"; 30 | } 31 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/QueryRecentGames.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Ea.Models.Query 6 | { 7 | public class QueryRecentGames 8 | { 9 | public class Variables 10 | { 11 | public List gameSlugs = new List(); 12 | } 13 | 14 | public Variables variables = new Variables(); 15 | public string query = @" 16 | query GetRecentGames($gameSlugs: [String!]!) { 17 | me { 18 | recentGames(gameSlugs: $gameSlugs) { 19 | items { 20 | gameSlug 21 | lastSessionEndDate 22 | totalPlayTimeSeconds 23 | } 24 | } 25 | } 26 | }"; 27 | } 28 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/AccountEntitlementsResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class AccountEntitlementsResponse 10 | { 11 | public class Entitlement 12 | { 13 | public long entitlementId; 14 | public string offerId; 15 | public string offerPath; 16 | public string status; 17 | public string offerType; 18 | public string originDisplayType; 19 | public string masterTitleId; 20 | public string gameDistributionSubType; 21 | } 22 | 23 | public string error; 24 | public List entitlements; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/StoreToken.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CommonPluginsStores.Models 4 | { 5 | /// 6 | /// Represents a store token, which consists of a type and an associated token value. 7 | /// 8 | public class StoreToken 9 | { 10 | public string AccountId { get; set; } 11 | 12 | /// 13 | /// Gets or sets the type of the token (e.g., authentication type). 14 | /// 15 | public string Type { get; set; } 16 | 17 | /// 18 | /// Gets or sets the token value (e.g., authentication token or session token). 19 | /// 20 | public string Token { get; set; } 21 | 22 | public DateTime? ExpireAt { get; set; } 23 | 24 | public string RefreshToken { get; set; } 25 | 26 | public DateTime? RefreshExpireAt { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/EpicLibrary/Models/OauthResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.EpicLibrary.Models 8 | { 9 | public class OauthResponse 10 | { 11 | public string access_token; 12 | public long expires_in; 13 | public DateTime expires_at; 14 | public string token_type; 15 | public string refresh_token; 16 | public long refresh_expires; 17 | public DateTime refresh_expires_at; 18 | public string account_id; 19 | public string client_id; 20 | public bool internal_client; 21 | public string client_service; 22 | public string app; 23 | public string in_app_id; 24 | public string device_id; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamFriendsList.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class SteamFriendsList 9 | { 10 | [SerializationPropertyName("friendslist")] 11 | public FriendsList FriendsList { get; set; } 12 | } 13 | 14 | public class Friend 15 | { 16 | [SerializationPropertyName("steamid")] 17 | public ulong SteamId { get; set; } 18 | [SerializationPropertyName("relationship")] 19 | public string Relationship { get; set; } 20 | [SerializationPropertyName("friend_since")] 21 | public int FriendSince { get; set; } 22 | } 23 | 24 | public class FriendsList 25 | { 26 | [SerializationPropertyName("friends")] 27 | public List Friends { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Crowdin](https://badges.crowdin.net/playnite-extensions/localized.svg)](https://crowdin.com/project/playnite-extensions) 2 | [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Lacro59/playnite-plugincommon)](https://github.com/Lacro59/playnite-plugincommon/graphs/commit-activity) 3 | [![GitHub contributors](https://img.shields.io/github/contributors/Lacro59/playnite-plugincommon?cacheSeconds=5000)](https://github.com/Lacro59/playnite-plugincommon/graphs/contributors) 4 | [![GitHub](https://img.shields.io/github/license/Lacro59/playnite-plugincommon?cacheSeconds=50000)](https://github.com/Lacro59/playnite-plugincommon/blob/master/LICENSE) 5 | 6 | # playnite-plugincommon 7 | Common files and functions at plugins for [Playnite](https://playnite.link). 8 | 9 | ## More 10 | Remember to support [Playnite](https://www.patreon.com/playnite) and [Freepik](https://www.flaticon.com/authors/freepik). 11 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/NegateConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | 9 | namespace CommonPlayniteShared.Converters 10 | { 11 | public class NegateConverter : MarkupExtension, IValueConverter 12 | { 13 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 14 | { 15 | return !(bool)value; 16 | } 17 | 18 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 19 | { 20 | return !(bool)value; 21 | } 22 | 23 | public override object ProvideValue(IServiceProvider serviceProvider) 24 | { 25 | return this; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/KeyImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class KeyImage 8 | { 9 | [SerializationPropertyName("type")] 10 | public string Type { get; set; } 11 | 12 | [SerializationPropertyName("url")] 13 | public string Url { get; set; } 14 | 15 | [SerializationPropertyName("md5")] 16 | public string Md5 { get; set; } 17 | 18 | [SerializationPropertyName("width")] 19 | public int? Width { get; set; } 20 | 21 | [SerializationPropertyName("height")] 22 | public int? Height { get; set; } 23 | 24 | [SerializationPropertyName("size")] 25 | public int? Size { get; set; } 26 | 27 | [SerializationPropertyName("uploadedDate")] 28 | public DateTime? UploadedDate { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/Xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Markup; 8 | 9 | namespace CommonPlayniteShared.Common 10 | { 11 | public class Xaml 12 | { 13 | public static object FromFile(string path) 14 | { 15 | using (var stream = new StreamReader(path)) 16 | { 17 | return XamlReader.Load(stream.BaseStream); 18 | } 19 | } 20 | 21 | public static T FromFile(string path) 22 | { 23 | using (var stream = new StreamReader(path)) 24 | { 25 | return (T)XamlReader.Load(stream.BaseStream); 26 | } 27 | } 28 | 29 | public static T FromString(string xaml) 30 | { 31 | return (T)XamlReader.Parse(xaml); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CommonPluginsResources/Resources/LiveChartsCommon/Common.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 4 | 2 5 | 10, 10 6 | 7 | #E4555555 8 | #555555 9 | #FFFFFFFF 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/InvertedBoolenConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Data; 9 | using System.Windows.Markup; 10 | 11 | namespace CommonPlayniteShared.Converters 12 | { 13 | public class InvertedBoolenConverter : MarkupExtension, IValueConverter 14 | { 15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | return !(bool)value; 18 | } 19 | 20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 21 | { 22 | return !(bool)value; 23 | } 24 | 25 | public override object ProvideValue(IServiceProvider serviceProvider) 26 | { 27 | return this; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Query/QueryPlayerAchievement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Epic.Models.Query 6 | { 7 | public class QueryPlayerAchievement 8 | { 9 | public class Variables 10 | { 11 | public string epicAccountId = ""; 12 | public string sandboxId = ""; 13 | } 14 | 15 | public Variables variables = new Variables(); 16 | public string query = @"query PlayerAchievement($epicAccountId:String!,$sandboxId:String!){PlayerAchievement{playerAchievementGameRecordsBySandbox(epicAccountId:$epicAccountId sandboxId:$sandboxId){records{totalXP totalUnlocked playerAwards{awardType unlockedDateTime achievementSetId} achievementSets{achievementSetId isBase totalUnlocked totalXP} playerAchievements{playerAchievement{sandboxId epicAccountId unlocked progress XP unlockDate achievementName isBase achievementSetId}}}}}}"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/ExtensionsAchievements.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Playnite.SDK.Data; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class Datum 9 | { 10 | [SerializationPropertyName("name")] 11 | public string Name { get; set; } 12 | 13 | [SerializationPropertyName("achievementApiNames")] 14 | public List AchievementApiNames { get; set; } 15 | 16 | [SerializationPropertyName("dlcAppId")] 17 | public int? DlcAppId { get; set; } 18 | 19 | [SerializationPropertyName("dlcAppName")] 20 | public string DlcAppName { get; set; } 21 | } 22 | 23 | public class ExtensionsAchievements 24 | { 25 | [SerializationPropertyName("success")] 26 | public bool Success { get; set; } 27 | 28 | [SerializationPropertyName("data")] 29 | public List Data { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/EnumToBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | 9 | namespace CommonPluginsShared.Converters 10 | { 11 | public class EnumToBooleanConverter : MarkupExtension, IValueConverter 12 | { 13 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 14 | { 15 | return value.Equals(parameter); 16 | } 17 | 18 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 19 | { 20 | return value.Equals(true) ? parameter : Binding.DoNothing; 21 | } 22 | 23 | public override object ProvideValue(IServiceProvider serviceProvider) 24 | { 25 | return this; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamAppList.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using Playnite.SDK.Data; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace CommonPluginsStores.Steam.Models 8 | { 9 | public class SteamApp 10 | { 11 | [SerializationPropertyName("appid")] 12 | public uint AppId { get; set; } 13 | 14 | [SerializationPropertyName("name")] 15 | public string Name { get; set; } 16 | 17 | [SerializationPropertyName("last_modified")] 18 | public int LastModified { get; set; } 19 | 20 | [SerializationPropertyName("price_change_number")] 21 | public int PriceChangeNumber { get; set; } 22 | } 23 | 24 | public class SteamAppList 25 | { 26 | [SerializationPropertyName("apps")] 27 | public List Apps { get; set; } 28 | 29 | [SerializationPropertyName("have_more_results")] 30 | public bool HaveMoreResults { get; set; } 31 | 32 | [SerializationPropertyName("last_appid")] 33 | public uint LastAppId { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/GlobalRandom.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.Common 8 | { 9 | public class GlobalRandom 10 | { 11 | private static readonly Random generator = new Random(); 12 | 13 | public static int Next() 14 | { 15 | return generator.Next(); 16 | } 17 | 18 | public static int Next(int minValue, int maxValue) 19 | { 20 | return generator.Next(minValue, maxValue); 21 | } 22 | 23 | public static int Next(int maxValue) 24 | { 25 | return generator.Next(maxValue); 26 | } 27 | 28 | public static void NextBytes(byte[] buffer) 29 | { 30 | NextBytes(buffer); 31 | } 32 | 33 | public static double NextDouble() 34 | { 35 | return generator.NextDouble(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/HeightToFontSizeConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class HeightToFontSizeConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | var height = (double)value; 22 | return .5 * height; 23 | } 24 | 25 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/ResponseFriends.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Ea.Models.Query 7 | { 8 | public class ResponseFriends 9 | { 10 | [SerializationPropertyName("data")] 11 | public DataFriends Data { get; set; } 12 | } 13 | 14 | public class DataFriends 15 | { 16 | [SerializationPropertyName("me")] 17 | public MeFriends Me { get; set; } 18 | } 19 | 20 | public class Friends 21 | { 22 | [SerializationPropertyName("items")] 23 | public List Items { get; set; } 24 | } 25 | 26 | public class ItemFriends 27 | { 28 | [SerializationPropertyName("player")] 29 | public Player Player { get; set; } 30 | } 31 | 32 | public class MeFriends 33 | { 34 | [SerializationPropertyName("friends")] 35 | public Friends Friends { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/TrophiesOverwiew.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class TrophiesOverwiew 11 | { 12 | [SerializationPropertyName("payload")] 13 | public PayloadTrophies Payload { get; set; } 14 | 15 | [SerializationPropertyName("ver")] 16 | public string Ver { get; set; } 17 | 18 | [SerializationPropertyName("user")] 19 | public object User { get; set; } 20 | 21 | [SerializationPropertyName("c")] 22 | public C C { get; set; } 23 | } 24 | 25 | public class PayloadTrophies 26 | { 27 | [SerializationPropertyName("trophies")] 28 | public List Trophies { get; set; } 29 | 30 | [SerializationPropertyName("pageSize")] 31 | public int PageSize { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/Theme.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class Theme 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("theme_preset_id")] 16 | public int ThemePresetId { get; set; } 17 | 18 | [SerializationPropertyName("highlight")] 19 | public string Highlight { get; set; } 20 | 21 | [SerializationPropertyName("backlight")] 22 | public string Backlight { get; set; } 23 | 24 | [SerializationPropertyName("notice")] 25 | public string Notice { get; set; } 26 | 27 | [SerializationPropertyName("tint")] 28 | public string Tint { get; set; } 29 | 30 | [SerializationPropertyName("custom")] 31 | public string Custom { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/GameInfos.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using CommonPluginsShared; 3 | using CommonPluginsShared.Extensions; 4 | using Playnite.SDK.Data; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Collections.ObjectModel; 8 | using System.Globalization; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Text.RegularExpressions; 12 | 13 | namespace CommonPluginsStores.Models 14 | { 15 | /// 16 | /// Represents detailed information about a game, including a list of downloadable content (DLC). 17 | /// Inherits from to include basic game details. 18 | /// 19 | public class GameInfos : BasicGameInfos 20 | { 21 | private ObservableCollection _dlcs; 22 | 23 | /// 24 | /// Gets or sets the list of downloadable content (DLC) associated with the game. 25 | /// 26 | public ObservableCollection Dlcs { get => _dlcs; set => _dlcs = value; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/ValueOperationConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace CommonPluginsShared.Converters 8 | { 9 | internal class ValueOperationConverter : IMultiValueConverter 10 | { 11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | try 14 | { 15 | return parameter.ToString() == "-" 16 | ? double.Parse(values[0].ToString()) - double.Parse(values[1].ToString()) 17 | : (object)(double.Parse(values[0].ToString()) + double.Parse(values[1].ToString())); 18 | } 19 | catch { } 20 | 21 | return double.NaN; 22 | } 23 | 24 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 25 | { 26 | throw new NotSupportedException(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CommonPluginsShared/Models/TraceInfos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace CommonPluginsShared.Models 10 | { 11 | public class TraceInfos 12 | { 13 | public string InitialCaller { get; set; } 14 | public ParameterInfo[] CallerParams { get; set; } 15 | 16 | public string FileName { get; set; } 17 | public int LineNumber { get; set; } 18 | 19 | public TraceInfos(Exception ex) 20 | { 21 | StackTrace Trace = new StackTrace(ex, true); 22 | StackFrame Frame = Trace.GetFrames()?.LastOrDefault(); 23 | InitialCaller = Frame?.GetMethod()?.Name; 24 | CallerParams = Frame?.GetMethod()?.GetParameters(); 25 | FileName = (Frame?.GetFileName()?.IsNullOrEmpty() ?? true) ? "???" : Frame.GetFileName(); 26 | LineNumber = Frame?.GetFileLineNumber() ?? 0; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DerivedStyles/HighlightBorder.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 17 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Common 9 | { 10 | public static class Constants 11 | { 12 | public const string DefaultDateTimeFormat = "d"; 13 | public const string DefaultPartialReleaseDateTimeFormat = "y"; 14 | 15 | public static string DateUiFormat 16 | { 17 | get; 18 | } = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern; 19 | 20 | public static string TimeUiFormat 21 | { 22 | get; 23 | } = CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern; 24 | 25 | public static char[] ListSeparators 26 | { 27 | get; 28 | } = new char[] { ListSeparator }; 29 | 30 | public const char ListSeparator = ','; 31 | 32 | public static readonly Guid MaxGuidVal = new Guid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"); 33 | } 34 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Mapping.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Playnite.SDK.Data; 3 | 4 | namespace CommonPluginsStores.Epic.Models 5 | { 6 | public class Mapping 7 | { 8 | [SerializationPropertyName("createdDate")] 9 | public string CreatedDate { get; set; } 10 | 11 | [SerializationPropertyName("deletedDate")] 12 | public string DeletedDate { get; set; } 13 | 14 | [SerializationPropertyName("mappings")] 15 | public Mappings Mappings { get; set; } 16 | 17 | [SerializationPropertyName("pageSlug")] 18 | public string PageSlug { get; set; } 19 | 20 | [SerializationPropertyName("pageType")] 21 | public string PageType { get; set; } 22 | 23 | [SerializationPropertyName("productId")] 24 | public string ProductId { get; set; } 25 | 26 | [SerializationPropertyName("sandboxId")] 27 | public string SandboxId { get; set; } 28 | 29 | [SerializationPropertyName("updatedDate")] 30 | public string UpdatedDate { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamKit/SteamSchema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Steam.Models.SteamKit 6 | { 7 | public class SteamSchema 8 | { 9 | public List Achievements { get; set; } = new List(); 10 | public List Stats { get; set; } = new List(); 11 | } 12 | 13 | public class SteamSchemaStats 14 | { 15 | public string Name { get; set; } 16 | public int DefaultValue { get; set; } 17 | public string DisplayName { get; set; } 18 | } 19 | 20 | public class SteamSchemaAchievements 21 | { 22 | public string Name { get; set; } 23 | public int DefaultValue { get; set; } 24 | public string DisplayName { get; set; } 25 | public bool Hidden { get; set; } 26 | public string Description { get; set; } 27 | public string Icon { get; set; } 28 | public string IconGray { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPluginsStores/Psn/Models/PsnApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Psn.Models 6 | { 7 | //public class PsnApi 8 | //{ 9 | //} 10 | 11 | 12 | public class Trophies 13 | { 14 | public List trophies { get; set; } 15 | } 16 | 17 | public class Trophie 18 | { 19 | public int trophyId { get; set; } 20 | public string trophyType { get; set; } 21 | 22 | public string trophyName { get; set; } 23 | public string trophyDetail { get; set; } 24 | public string trophyIconUrl { get; set; } 25 | 26 | 27 | public bool trophyHidden { get; set; } 28 | public bool earned { get; set; } 29 | public DateTime? earnedDateTime { get; set; } 30 | public int trophyRare { get; set; } 31 | public string trophyEarnedRate { get; set; } 32 | } 33 | 34 | public class FromUser 35 | { 36 | public string onlineId { get; set; } 37 | public DateTime earnedDate { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/AchievementProgression.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | 3 | namespace CommonPluginsStores.Models 4 | { 5 | public class AchievementProgression 6 | { 7 | /// 8 | /// Gets or sets the unique identifier for the achievement. 9 | /// 10 | public string Id { get; set; } 11 | 12 | /// 13 | /// Gets or sets the minimum value for progression. 14 | /// 15 | public double Min { get; set; } 16 | 17 | /// 18 | /// Gets or sets the maximum value for progression. 19 | /// 20 | public double Max { get; set; } 21 | 22 | /// 23 | /// Gets or sets the current value for progression. 24 | /// 25 | public double Value { get; set; } 26 | 27 | /// 28 | /// Gets a string representation of the progression (e.g., "3 / 10"). 29 | /// 30 | [DontSerialize] 31 | public string Progression => Value + " / " + Max; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CommonPluginsStores/CommonPluginsStores.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | c066f255-3bfa-4862-a490-09d7933647d4 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CommonPlayniteShared/CommonPlayniteShared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0d7dbc82-26af-49ad-8ed5-0e11aa56bce0 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Extensions/IProvideValueTarget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Markup; 9 | 10 | namespace CommonPlayniteShared.Extensions 11 | { 12 | public static class IProvideValueTargetExtensions 13 | { 14 | public static Type GetTargetType(IProvideValueTarget provider) 15 | { 16 | if (provider.TargetProperty == null) 17 | { 18 | return null; 19 | } 20 | 21 | var type = provider.TargetProperty.GetType(); 22 | if (type == typeof(DependencyProperty)) 23 | { 24 | type = ((DependencyProperty)provider.TargetProperty).PropertyType; 25 | } 26 | else if (typeof(PropertyInfo).IsAssignableFrom(provider.TargetProperty.GetType())) 27 | { 28 | type = ((PropertyInfo)provider.TargetProperty).PropertyType; 29 | } 30 | 31 | return type; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/NintendoLibrary/Models/NintendoModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.NintendoLibrary.Models 8 | { 9 | public class AuthError 10 | { 11 | public class Error 12 | { 13 | public string code { get; set; } 14 | public string message { get; set; } 15 | } 16 | public Error error; 17 | } 18 | 19 | public class PurchasedList 20 | { 21 | public int length { get; set; } 22 | public int offset { get; set; } 23 | public int total { get; set; } 24 | public class Transaction 25 | { 26 | public string content_type { get; set; } 27 | public string title { get; set; } 28 | public string device_type { get; set; } 29 | public DateTime date { get; set; } 30 | public ulong transaction_id { get; set; } 31 | } 32 | 33 | public List transactions { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Lacro59 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/QueryAchievements.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CommonPluginsStores.Ea.Models.Query 6 | { 7 | public class QueryAchievements 8 | { 9 | public class Variables 10 | { 11 | public string offerId = string.Empty; 12 | public string playerPsd = string.Empty; 13 | public string locale = "US"; 14 | } 15 | 16 | public Variables variables = new Variables(); 17 | public string query = @" 18 | query GetAchievements($offerId: String!, $playerPsd: String!, $locale: Locale!) { 19 | achievements( 20 | offerId: $offerId 21 | playerPsd: $playerPsd 22 | showHidden: true 23 | locale: $locale 24 | ) { 25 | id 26 | achievements { 27 | id 28 | name 29 | description 30 | awardCount 31 | date 32 | } 33 | } 34 | }"; 35 | } 36 | } -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/TwoBooleanToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class TwoBooleanToVisibilityConverter : IMultiValueConverter 18 | { 19 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | bool a = (bool)values[0]; 22 | bool b = (bool)values[1]; 23 | 24 | return a && b ? Visibility.Visible : Visibility.Collapsed; 25 | } 26 | 27 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/TextBlock.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | -------------------------------------------------------------------------------- /CommonPluginsControls/Controls/ComboBoxRemovable.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace CommonPluginsControls.Controls 17 | { 18 | /// 19 | /// Logique d'interaction pour ComboBoxRemovable.xaml 20 | /// 21 | public partial class ComboBoxRemovable : ComboBox 22 | { 23 | public event RoutedEventHandler ClearEvent; 24 | 25 | 26 | public ComboBoxRemovable() 27 | { 28 | InitializeComponent(); 29 | } 30 | 31 | 32 | private void PART_ClearButton_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.Text = string.Empty; 35 | this.SelectedIndex = -1; 36 | 37 | this.ClearEvent?.Invoke(sender, e); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Shlwapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Native 9 | { 10 | [Flags] 11 | public enum MatchPatternFlags : uint 12 | { 13 | Normal = 0x00000000, // PMSF_NORMAL 14 | Multiple = 0x00000001, // PMSF_MULTIPLE 15 | DontStripSpaces = 0x00010000 // PMSF_DONT_STRIP_SPACES 16 | } 17 | 18 | public class Shlwapi 19 | { 20 | private const string dllName = "Shlwapi.dll"; 21 | 22 | [DllImport(dllName, BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false, ThrowOnUnmappableChar = true)] 23 | public static extern int SHLoadIndirectString(string pszSource, StringBuilder pszOutBuf, int cchOutBuf, IntPtr ppvReserved); 24 | 25 | [DllImport(dllName, SetLastError = false)] 26 | public static extern int PathMatchSpecExW([MarshalAs(UnmanagedType.LPWStr)] string file, [MarshalAs(UnmanagedType.LPWStr)] string spec, MatchPatternFlags flags); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamAchievementData.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using Playnite.SDK.Data; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace CommonPluginsStores.Steam.Models 8 | { 9 | public class SteamAchievementData 10 | { 11 | [SerializationPropertyName("rawname")] 12 | public string RawName { get; set; } 13 | [SerializationPropertyName("hidden")] 14 | public bool Hidden { get; set; } 15 | [SerializationPropertyName("closed")] 16 | public int Closed { get; set; } 17 | [SerializationPropertyName("unlock_time")] 18 | public int UnlockTime { get; set; } 19 | [SerializationPropertyName("icon_closed")] 20 | public string IconClosed { get; set; } 21 | [SerializationPropertyName("icon_open")] 22 | public string IconOpen { get; set; } 23 | [SerializationPropertyName("progress")] 24 | public dynamic Progress { get; set; } 25 | [SerializationPropertyName("name")] 26 | public string Name { get; set; } 27 | [SerializationPropertyName("desc")] 28 | public string Desc { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonPluginsShared/CumulsErrors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CommonPluginsShared 5 | { 6 | /// 7 | /// Group erros message in order to haven't duplicate. 8 | /// 9 | public class CumulErrors 10 | { 11 | private List ListMessage = new List(); 12 | 13 | 14 | /// 15 | /// Add a new error message. 16 | /// 17 | /// 18 | public void Add(string Message) 19 | { 20 | if (!ListMessage.Exists(x => x == Message)) 21 | { 22 | ListMessage.Add(Message); 23 | } 24 | } 25 | 26 | /// 27 | /// Get list errors messages formatted. 28 | /// 29 | /// 30 | public string Get() 31 | { 32 | string Result = string.Empty; 33 | for (int i = 0; i < ListMessage.Count; i++) 34 | { 35 | Result += ((i != 0) ? Environment.NewLine : string.Empty) + ListMessage[i]; 36 | } 37 | return Result; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamGameAchievements.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class SteamAchievement 9 | { 10 | [SerializationPropertyName("internal_name")] 11 | public string InternalName { get; set; } 12 | [SerializationPropertyName("localized_name")] 13 | public string LocalizedName { get; set; } 14 | [SerializationPropertyName("localized_desc")] 15 | public string LocalizedDesc { get; set; } 16 | [SerializationPropertyName("icon")] 17 | public string Icon { get; set; } 18 | [SerializationPropertyName("icon_gray")] 19 | public string IconGray { get; set; } 20 | [SerializationPropertyName("hidden")] 21 | public bool Hidden { get; set; } 22 | [SerializationPropertyName("player_percent_unlocked")] 23 | public string PlayerPercentUnlocked { get; set; } 24 | } 25 | 26 | public class SteamGameAchievements 27 | { 28 | [SerializationPropertyName("achievements")] 29 | public List Achievements { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Asset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Playnite.SDK.Data; 4 | 5 | namespace CommonPluginsStores.Epic.Models 6 | { 7 | public class Asset 8 | { 9 | [SerializationPropertyName("namespace")] 10 | public string Namespace { get; set; } 11 | 12 | [SerializationPropertyName("catalogItemId")] 13 | public string CatalogItemId { get; set; } 14 | 15 | [SerializationPropertyName("appName")] 16 | public string AppName { get; set; } 17 | 18 | [SerializationPropertyName("productId")] 19 | public string ProductId { get; set; } 20 | 21 | [SerializationPropertyName("sandboxName")] 22 | public string SandboxName { get; set; } 23 | 24 | [SerializationPropertyName("sandboxType")] 25 | public string SandboxType { get; set; } 26 | 27 | [SerializationPropertyName("recordType")] 28 | public string RecordType { get; set; } 29 | 30 | [SerializationPropertyName("acquisitionDate")] 31 | public DateTime AcquisitionDate { get; set; } 32 | 33 | [SerializationPropertyName("dependencies")] 34 | public List Dependencies { get; set; } 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/ImageToGrayConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class ImageToGrayConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | if (value is string str && !str.IsNullOrEmpty()) 22 | { 23 | BitmapImage tmpImg = BitmapExtensions.BitmapFromFile(ImageSourceManagerPlugin.GetImagePath(str)); 24 | return ImageTools.ConvertBitmapImage(tmpImg, ImageColor.Gray); 25 | } 26 | 27 | return value; 28 | } 29 | 30 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/GetImageConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class GetImageConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value is string) 24 | { 25 | return ImageSourceManagerPlugin.GetImagePath((string)value); 26 | } 27 | } 28 | catch (Exception ex) 29 | { 30 | Common.LogError(ex, false); 31 | } 32 | 33 | return value; 34 | } 35 | 36 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/ToolTip.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/Extensions/ItemsControlExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Media; 9 | 10 | namespace System.Windows.Controls 11 | { 12 | public static class ItemsControlExtensions 13 | { 14 | public static void ScrollIntoView(this ItemsControl control, object item) 15 | { 16 | var framework = control.ItemContainerGenerator.ContainerFromItem(item) as FrameworkElement; 17 | if (framework == null) 18 | { 19 | return; 20 | } 21 | 22 | framework.BringIntoView(); 23 | } 24 | 25 | public static void ScrollIntoView(this ItemsControl control) 26 | { 27 | int count = control.Items.Count; 28 | if (count == 0) 29 | { 30 | return; 31 | } 32 | 33 | object item = control.Items[count - 1]; 34 | control.ScrollIntoView(item); 35 | } 36 | 37 | public static string ToHtml(this Color color) 38 | { 39 | return $"#{color.R:X2}{color.G:X2}{color.B:X2}"; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/UsageReponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Xml.Linq; 7 | 8 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 9 | { 10 | public class UsageResponse 11 | { 12 | public UsageResponse(string xml) 13 | { 14 | this.total = 0; 15 | this.lastSessionEndTimeStamp = null; 16 | 17 | var usage = XElement.Parse(xml); 18 | 19 | string value = usage?.Element("total")?.Value; 20 | if (!string.IsNullOrEmpty(value)) 21 | { 22 | long.TryParse(value, out this.total); 23 | } 24 | 25 | value = usage?.Element("lastSessionEndTimeStamp")?.Value; 26 | if (!string.IsNullOrEmpty(value)) 27 | { 28 | long time = 0; 29 | if (long.TryParse(value, out time) && time > 0) 30 | { 31 | this.lastSessionEndTimeStamp = DateTimeOffset.FromUnixTimeMilliseconds(time).DateTime; 32 | } 33 | } 34 | } 35 | 36 | public long total; 37 | public DateTime? lastSessionEndTimeStamp; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/ResponseRecentGames.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Ea.Models.Query 7 | { 8 | public class ResponseRecentGames 9 | { 10 | [SerializationPropertyName("data")] 11 | public DataRecentGames Data { get; set; } 12 | } 13 | 14 | public class DataRecentGames 15 | { 16 | [SerializationPropertyName("me")] 17 | public MeRecentGames Me { get; set; } 18 | } 19 | 20 | public class ItemRecentGames 21 | { 22 | [SerializationPropertyName("gameSlug")] 23 | public string GameSlug { get; set; } 24 | 25 | [SerializationPropertyName("lastSessionEndDate")] 26 | public DateTime LastSessionEndDate { get; set; } 27 | 28 | [SerializationPropertyName("totalPlayTimeSeconds")] 29 | public int TotalPlayTimeSeconds { get; set; } 30 | } 31 | 32 | public class MeRecentGames 33 | { 34 | [SerializationPropertyName("recentGames")] 35 | public RecentGames RecentGames { get; set; } 36 | } 37 | 38 | public class RecentGames 39 | { 40 | [SerializationPropertyName("items")] 41 | public List Items { get; set; } 42 | } 43 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Processthreadsapi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Native 9 | { 10 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] 11 | public struct STARTUPINFO 12 | { 13 | public Int32 cb; 14 | public IntPtr lpReserved; 15 | public IntPtr lpDesktop; 16 | public IntPtr lpTitle; 17 | public Int32 dwX; 18 | public Int32 dwY; 19 | public Int32 dwXSize; 20 | public Int32 dwYSize; 21 | public Int32 dwXCountChars; 22 | public Int32 dwYCountChars; 23 | public Int32 dwFillAttribute; 24 | public Int32 dwFlags; 25 | public Int16 wShowWindow; 26 | public Int16 cbReserved2; 27 | public IntPtr lpReserved2; 28 | public IntPtr hStdInput; 29 | public IntPtr hStdOutput; 30 | public IntPtr hStdError; 31 | } 32 | 33 | [StructLayout(LayoutKind.Sequential)] 34 | public struct PROCESS_INFORMATION 35 | { 36 | public IntPtr hProcess; 37 | public IntPtr hThread; 38 | public int dwProcessId; 39 | public int dwThreadId; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/StringRemoveConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class StringRemoveConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value is string && parameter is string) 24 | { 25 | return ((string)value).Replace((string)parameter, string.Empty); 26 | } 27 | } 28 | catch (Exception ex) 29 | { 30 | Common.LogError(ex, false); 31 | } 32 | 33 | return value; 34 | } 35 | 36 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CommonPluginsShared/Interfaces/IPluginDatabase.cs: -------------------------------------------------------------------------------- 1 | using CommonPluginsShared.Collections; 2 | using Playnite.SDK; 3 | using Playnite.SDK.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsShared.Interfaces 9 | { 10 | public interface IPluginDatabase 11 | { 12 | string PluginName { get; set; } 13 | 14 | bool IsLoaded { get; set; } 15 | 16 | Task InitializeDatabase(); 17 | 18 | PluginDataBaseGameBase Get(Game game, bool onlyCache = false, bool force = false); 19 | PluginDataBaseGameBase Get(Guid id, bool onlyCache = false, bool force = false); 20 | 21 | PluginDataBaseGameBase GetClone(Guid id); 22 | PluginDataBaseGameBase GetClone(Game game); 23 | 24 | PluginDataBaseGameBase MergeData(Guid fromId, Guid toId); 25 | 26 | bool Remove(Game game); 27 | bool Remove(Guid id); 28 | 29 | void AddOrUpdate(PluginDataBaseGameBase item); 30 | 31 | void Refresh(Guid id); 32 | void Refresh(IEnumerable ids); 33 | 34 | [Obsolete("Use Refresh(ids)")] 35 | void RefreshWithNoData(IEnumerable ids); 36 | 37 | IEnumerable GetGamesWithNoData(); 38 | 39 | IEnumerable GetGamesOldData(int months); 40 | } 41 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/TwoBooleanToBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Data; 5 | 6 | namespace CommonPlayniteShared.Converters 7 | { 8 | public class TwoBooleanToBooleanConverter : IMultiValueConverter 9 | { 10 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 11 | { 12 | bool a = (bool)values[0]; 13 | bool b = (bool)values[1]; 14 | 15 | if (parameter is string) 16 | { 17 | if ((string)parameter == "inverted") 18 | { 19 | return !a && !b; 20 | } 21 | 22 | if ((string)parameter == "firsttrue") 23 | { 24 | return a && !b; 25 | } 26 | if ((string)parameter == "secondtrue") 27 | { 28 | return !a && b; 29 | } 30 | } 31 | 32 | return a && b; 33 | } 34 | 35 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CommonPluginsResources/Resources/Controls/ListExtendStyle.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 13 | 21 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/ListMoreOneBoolConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Collections; 5 | using System.Drawing.Imaging; 6 | using System.Globalization; 7 | using System.IO; 8 | using System.Text.RegularExpressions; 9 | using System.Windows; 10 | using System.Windows.Controls; 11 | using System.Windows.Data; 12 | using System.Windows.Markup; 13 | using System.Windows.Media; 14 | using System.Windows.Media.Imaging; 15 | 16 | namespace CommonPluginsShared.Converters 17 | { 18 | public class ListMoreOneBoolConverter : IValueConverter 19 | { 20 | public object Convert(object value, Type TargetType, object parameter, CultureInfo culture) 21 | { 22 | try 23 | { 24 | if (value is IList) 25 | { 26 | return ((IList)value).Count > 1; 27 | } 28 | 29 | return string.Empty; 30 | } 31 | catch (Exception ex) 32 | { 33 | Common.LogError(ex, false); 34 | return false; 35 | } 36 | } 37 | 38 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /CommonPluginsShared/Plugins/PluginMenu.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Models; 2 | using Playnite.SDK.Plugins; 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using static CommonPluginsShared.PlayniteTools; 8 | 9 | namespace CommonPluginsShared.Plugins 10 | { 11 | public class PluginMenu 12 | { 13 | private List PluginElements { get; set; } 14 | 15 | 16 | public PluginMenu(List ExternalPlugins) 17 | { 18 | ExternalPlugins.ForEach(x => 19 | { 20 | PluginElements = new List { new PluginElement(x) }; 21 | }); 22 | } 23 | 24 | 25 | public IEnumerable GetGameMenuItems(List Games, bool PurgeMenus = true) 26 | { 27 | List gameMenuItems = new List(); 28 | PluginElements.ForEach(x => 29 | { 30 | IEnumerable PluginMenus = PurgeMenus ? x.GetGameMenuItemsPurged(Games) : x.GetGameMenuItems(Games); 31 | if (PluginMenus != null) 32 | { 33 | gameMenuItems = gameMenuItems.Concat(PluginMenus).ToList(); 34 | } 35 | }); 36 | return gameMenuItems; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/IndexConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Controls; 4 | using System.Windows.Data; 5 | 6 | namespace CommonPluginsShared.Converters 7 | { 8 | public class IndexConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type TargetType, object parameter, CultureInfo culture) 11 | { 12 | try 13 | { 14 | if (value is ListBoxItem item) 15 | { 16 | ListBox listView = ItemsControl.ItemsControlFromItemContainer(item) as ListBox; 17 | if (listView == null) 18 | { 19 | return "-1"; 20 | } 21 | int index = listView.ItemContainerGenerator.IndexFromContainer(item); 22 | return index.ToString(); 23 | } 24 | 25 | return string.Empty; 26 | } 27 | catch (Exception ex) 28 | { 29 | Common.LogError(ex, false); 30 | return string.Empty; 31 | } 32 | } 33 | 34 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 35 | { 36 | throw new NotImplementedException(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/ObjectToStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Data; 7 | using System.Windows.Markup; 8 | using System.Windows.Media; 9 | 10 | namespace CommonPlayniteShared.Converters 11 | { 12 | public class ObjectToStringConverter : MarkupExtension, IValueConverter 13 | { 14 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 15 | { 16 | if (value == null) 17 | { 18 | return null; 19 | } 20 | else 21 | { 22 | if (value is Enum enumVar) 23 | { 24 | return enumVar.GetDescription(); 25 | } 26 | else 27 | { 28 | return value.ToString(); 29 | } 30 | } 31 | } 32 | 33 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 34 | { 35 | return new NotSupportedException(); 36 | } 37 | 38 | public override object ProvideValue(IServiceProvider serviceProvider) 39 | { 40 | return this; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/Sellable.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class Sellable 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("type")] 16 | public string Type { get; set; } 17 | 18 | [SerializationPropertyName("primary")] 19 | public bool Primary { get; set; } 20 | 21 | [SerializationPropertyName("key")] 22 | public string Key { get; set; } 23 | 24 | [SerializationPropertyName("title")] 25 | public string Title { get; set; } 26 | 27 | [SerializationPropertyName("description")] 28 | public object Description { get; set; } 29 | 30 | [SerializationPropertyName("pricings")] 31 | public List Pricings { get; set; } 32 | 33 | [SerializationPropertyName("linked_key_providers")] 34 | public List LinkedKeyProviders { get; set; } 35 | 36 | [SerializationPropertyName("resource_type")] 37 | public string ResourceType { get; set; } 38 | 39 | [SerializationPropertyName("resource")] 40 | public Resource Resource { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPluginsControls/PlayniteControls/SearchBox.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/ResponseAchievements.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Ea.Models.Query 7 | { 8 | public class ResponseAchievements 9 | { 10 | [SerializationPropertyName("data")] 11 | public DataAchievements Data { get; set; } 12 | } 13 | 14 | public class Achievement 15 | { 16 | [SerializationPropertyName("id")] 17 | public string Id { get; set; } 18 | 19 | [SerializationPropertyName("name")] 20 | public string Name { get; set; } 21 | 22 | [SerializationPropertyName("description")] 23 | public string Description { get; set; } 24 | 25 | [SerializationPropertyName("awardCount")] 26 | public int AwardCount { get; set; } 27 | 28 | [SerializationPropertyName("date")] 29 | public DateTime Date { get; set; } 30 | } 31 | 32 | public class Achievements 33 | { 34 | [SerializationPropertyName("id")] 35 | public string Id { get; set; } 36 | 37 | [SerializationPropertyName("achievements")] 38 | public List AchievementsData { get; set; } 39 | } 40 | 41 | public class DataAchievements 42 | { 43 | [SerializationPropertyName("achievements")] 44 | public List Achievements { get; set; } 45 | } 46 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Models/StoreCurrency.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Models 7 | { 8 | public class StoreCurrency 9 | { 10 | public string country { get; set; } 11 | public string currency { get; set; } 12 | public string symbol { get; set; } 13 | 14 | [DontSerialize] 15 | public string text 16 | { 17 | get 18 | { 19 | string textFormated = string.Empty; 20 | if (!country.IsNullOrEmpty()) 21 | { 22 | textFormated += country.ToUpper(); 23 | } 24 | if (!currency.IsNullOrEmpty()) 25 | { 26 | if (!textFormated.IsNullOrEmpty()) 27 | { 28 | textFormated += " - "; 29 | } 30 | textFormated += currency.ToUpper(); 31 | } 32 | if (!symbol.IsNullOrEmpty()) 33 | { 34 | if (!textFormated.IsNullOrEmpty()) 35 | { 36 | textFormated += " - "; 37 | } 38 | textFormated += symbol; 39 | } 40 | return textFormated; 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/StringToBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class StringToBooleanConverter : IValueConverter 18 | { 19 | enum Parameters 20 | { 21 | Normal, Inverted 22 | } 23 | 24 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | var direction = parameter == null ? Parameters.Normal : (Parameters)Enum.Parse(typeof(Parameters), (string)parameter); 27 | if (direction == Parameters.Inverted) 28 | { 29 | return string.IsNullOrEmpty(value.ToString()) ? true : false; 30 | } 31 | else 32 | { 33 | return string.IsNullOrEmpty(value.ToString()) ? false : true; 34 | } 35 | } 36 | 37 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/Trophy.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class Trophy 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("user_id")] 16 | public int UserId { get; set; } 17 | 18 | [SerializationPropertyName("game_id")] 19 | public int GameId { get; set; } 20 | 21 | [SerializationPropertyName("game_trophy_id")] 22 | public int GameTrophyId { get; set; } 23 | 24 | [SerializationPropertyName("logged_on")] 25 | public long? LoggedOn { get; set; } 26 | 27 | [SerializationPropertyName("viewed_on")] 28 | public long? ViewedOn { get; set; } 29 | 30 | [SerializationPropertyName("game_trophy")] 31 | public GameTrophy GameTrophy { get; set; } 32 | 33 | [SerializationPropertyName("user")] 34 | public User User { get; set; } 35 | 36 | [SerializationPropertyName("game")] 37 | public Game Game { get; set; } 38 | 39 | [SerializationPropertyName("site_trophy_id")] 40 | public int? SiteTrophyId { get; set; } 41 | 42 | [SerializationPropertyName("site_trophy")] 43 | public SiteTrophy SiteTrophy { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/SiteTrophy.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class SiteTrophy 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("difficulty")] 16 | public int Difficulty { get; set; } 17 | 18 | [SerializationPropertyName("title")] 19 | public string Title { get; set; } 20 | 21 | [SerializationPropertyName("description")] 22 | public string Description { get; set; } 23 | 24 | [SerializationPropertyName("secret")] 25 | public bool Secret { get; set; } 26 | 27 | [SerializationPropertyName("experience")] 28 | public int Experience { get; set; } 29 | 30 | [SerializationPropertyName("img_thumbnail")] 31 | public string ImgThumbnail { get; set; } 32 | 33 | [SerializationPropertyName("has_thumbnail")] 34 | public bool HasThumbnail { get; set; } 35 | 36 | [SerializationPropertyName("is_owner")] 37 | public bool IsOwner { get; set; } 38 | 39 | [SerializationPropertyName("artist")] 40 | public Artist Artist { get; set; } 41 | 42 | [SerializationPropertyName("is_achieved")] 43 | public bool IsAchieved { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/LocalTimeConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class LocalTimeConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value != null && (DateTime)value != default(DateTime)) 24 | { 25 | return ((DateTime)value).ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern); 26 | } 27 | else 28 | { 29 | return string.Empty; 30 | } 31 | } 32 | catch (Exception ex) 33 | { 34 | Common.LogError(ex, false); 35 | return string.Empty; 36 | } 37 | } 38 | 39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CommonPluginsStores/Uplay/UplayAPI.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared.Common; 2 | using Playnite.SDK; 3 | using Playnite.SDK.Data; 4 | using System; 5 | using System.Linq; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using System.IO; 9 | 10 | namespace CommonPluginsStores 11 | { 12 | public class UplayAPI 13 | { 14 | private static ILogger Logger => LogManager.GetLogger(); 15 | 16 | 17 | public UplayAPI() 18 | { 19 | } 20 | 21 | 22 | public string GetInstallationPath() 23 | { 24 | var progs = Programs.GetUnistallProgramsList().FirstOrDefault(a => a.DisplayName == "Ubisoft Connect"); 25 | if (progs == null) 26 | { 27 | return string.Empty; 28 | } 29 | else 30 | { 31 | return progs.InstallLocation; 32 | } 33 | } 34 | 35 | public string GetScreeshotsPath() 36 | { 37 | string configPath = Path.Combine(Environment.GetEnvironmentVariable("AppData"), "..", "Local", "Ubisoft Game Launcher", "settings.yaml"); 38 | if (File.Exists(configPath)) 39 | { 40 | dynamic SettingsData = Serialization.FromYamlFile(configPath); 41 | return ((string)SettingsData["misc"]["screenshot_root_path"]).Replace('/', Path.DirectorySeparatorChar); 42 | } 43 | 44 | return string.Empty; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/Label.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 23 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/StringNullOrEmptyToBoolConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Data; 8 | using System.Windows.Markup; 9 | 10 | namespace CommonPlayniteShared.Converters 11 | { 12 | public class StringNullOrEmptyToBoolConverter : MarkupExtension, IValueConverter 13 | { 14 | enum Parameters 15 | { 16 | Normal, Inverted 17 | } 18 | 19 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | var direction = parameter == null ? Parameters.Normal : (Parameters)Enum.Parse(typeof(Parameters), (string)parameter); 22 | if (direction == Parameters.Inverted) 23 | { 24 | return string.IsNullOrEmpty(value as string) ? true : false; 25 | } 26 | else 27 | { 28 | return string.IsNullOrEmpty(value as string) ? false : true; 29 | } 30 | } 31 | 32 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 33 | { 34 | return new NotSupportedException(); 35 | } 36 | 37 | public override object ProvideValue(IServiceProvider serviceProvider) 38 | { 39 | return this; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPluginsControls/Stores/Steam/PanelViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CommonPluginsStores.Models; 3 | using CommonPluginsStores.Models.Enumerations; 4 | using CommonPluginsStores.Models.Interfaces; 5 | using Playnite.SDK; 6 | 7 | namespace CommonPluginsControls.Stores.Steam 8 | { 9 | public class PanelViewModel : ObservableObject 10 | { 11 | internal IStoreApi StoreApi { get; set; } 12 | public AccountInfos User => StoreApi?.CurrentAccountInfos; 13 | 14 | private bool useApi = true; 15 | public bool UseApi { get => useApi; set => SetValue(ref useApi, value); } 16 | 17 | private bool useAuth = true; 18 | public bool UseAuth { get => useAuth; set => SetValue(ref useAuth, value); } 19 | 20 | private bool forceAuth = false; 21 | public bool ForceAuth { get => forceAuth; set => SetValue(ref forceAuth, value); } 22 | 23 | public AuthStatus AuthStatus => StoreApi == null ? AuthStatus.Failed : StoreApi.IsUserLoggedIn ? AuthStatus.Ok : AuthStatus.AuthRequired; 24 | 25 | public RelayCommand LoginCommand => new RelayCommand((a) => 26 | { 27 | StoreApi.Login(); 28 | OnPropertyChanged(nameof(AuthStatus)); 29 | OnPropertyChanged(nameof(User)); 30 | }); 31 | 32 | public void ResetIsUserLoggedIn() 33 | { 34 | StoreApi.ResetIsUserLoggedIn(); 35 | OnPropertyChanged(nameof(AuthStatus)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CommonPluginsControls/Views/ListDataUpdated.xaml.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using Playnite.SDK.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Windows.Controls; 8 | 9 | namespace CommonPluginsControls.Views 10 | { 11 | /// 12 | /// Logique d'interaction pour ListDataUpdated.xaml 13 | /// 14 | public partial class ListDataUpdated : UserControl 15 | { 16 | private List gameUpdatedDatas = new List(); 17 | RelayCommand GoToGame { get; set; } 18 | 19 | 20 | public ListDataUpdated(List games) 21 | { 22 | InitializeComponent(); 23 | 24 | 25 | GoToGame = new RelayCommand((Id) => 26 | { 27 | API.Instance.MainView.SelectGame(Id); 28 | API.Instance.MainView.SwitchToLibraryView(); 29 | }); 30 | 31 | 32 | gameUpdatedDatas = games.Select(x => new GameUpdatedData { Id = x.Id, Name = x.Name, GoToGame = GoToGame }).ToList(); 33 | ListViewGames.ItemsSource = gameUpdatedDatas; 34 | 35 | PART_Count.Content = gameUpdatedDatas.Count; 36 | 37 | ListViewGames.Sorting(); 38 | } 39 | } 40 | 41 | 42 | public class GameUpdatedData 43 | { 44 | public Guid Id { get; set; } 45 | public string Name { get; set; } 46 | public RelayCommand GoToGame { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/ProfileTrophiesGame.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class ProfileTrophiesGame 11 | { 12 | [SerializationPropertyName("payload")] 13 | public PayloadProfileTrophiesGame Payload { get; set; } 14 | 15 | [SerializationPropertyName("ver")] 16 | public string Ver { get; set; } 17 | 18 | [SerializationPropertyName("user")] 19 | public object User { get; set; } 20 | 21 | [SerializationPropertyName("c")] 22 | public C C { get; set; } 23 | } 24 | 25 | public class Completion 26 | { 27 | [SerializationPropertyName("experience")] 28 | public int Experience { get; set; } 29 | 30 | [SerializationPropertyName("totalCount")] 31 | public int TotalCount { get; set; } 32 | 33 | [SerializationPropertyName("achievedCount")] 34 | public int AchievedCount { get; set; } 35 | } 36 | 37 | public class PayloadProfileTrophiesGame 38 | { 39 | [SerializationPropertyName("trophies")] 40 | public List Trophies { get; set; } 41 | 42 | [SerializationPropertyName("game")] 43 | public Game Game { get; set; } 44 | 45 | [SerializationPropertyName("completion")] 46 | public Completion Completion { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/StoreSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CommonPluginsStores.Models 5 | { 6 | /// 7 | /// Represents configuration settings for the store. 8 | /// 9 | public class StoreSettings : ObservableObject 10 | { 11 | private bool _useApi; 12 | 13 | /// 14 | /// Gets or sets a value indicating whether to use the API. 15 | /// Default is false. 16 | /// 17 | public bool UseApi { get => _useApi; set => SetValue(ref _useApi, value); } 18 | 19 | private bool _useAuth; 20 | 21 | /// 22 | /// Gets or sets a value indicating whether to use authentication. 23 | /// Returns true if is true, even if the internal setting is false. 24 | /// Setting this value only affects the internal _useAuth field. 25 | /// 26 | public bool UseAuth { get => ForceAuth || _useAuth; set => SetValue(ref _useAuth, value); } 27 | 28 | 29 | private bool _forceAuth; 30 | 31 | /// 32 | /// Gets or sets a value indicating whether authentication is forced. 33 | /// When true, will always return true, regardless of the internal _useAuth setting. 34 | /// 35 | public bool ForceAuth { get => _forceAuth; set => SetValue(ref _forceAuth, value); } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/LocalDateConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class LocalDateConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value != null && (DateTime)value != default) 24 | { 25 | DateTime dt = ((DateTime)value).ToLocalTime(); 26 | return dt.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern); 27 | } 28 | else 29 | { 30 | return string.Empty; 31 | } 32 | } 33 | catch (Exception ex) 34 | { 35 | Common.LogError(ex, false); 36 | return string.Empty; 37 | } 38 | } 39 | 40 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 41 | { 42 | throw new NotImplementedException(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/BasicAccountGameInfos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CommonPluginsStores.Models 5 | { 6 | /// 7 | /// Represents basic information about a game associated with an account. 8 | /// 9 | public class BasicAccountGameInfos : ObservableObject 10 | { 11 | private string _id; 12 | 13 | /// 14 | /// Gets or sets the game identifier. 15 | /// 16 | public string Id { get => _id; set => _id = value; } 17 | 18 | private string _name; 19 | 20 | /// 21 | /// Gets or sets the name of the game. 22 | /// 23 | public string Name { get => _name; set => _name = value; } 24 | 25 | private string _image; 26 | 27 | /// 28 | /// Gets or sets the URL of the game's image (e.g., thumbnail or poster). 29 | /// 30 | public string Image { get => _image; set => _image = value; } 31 | 32 | private DateTime? _released; 33 | 34 | /// 35 | /// Gets or sets the release date of the game. 36 | /// 37 | public DateTime? Released { get => _released; set => _released = value; } 38 | 39 | private string _link; 40 | 41 | /// 42 | /// Gets or sets the link to the game's page or store. 43 | /// 44 | public string Link { get => _link; set => _link = value; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/GameStoreDataResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class GameStoreDataResponse 10 | { 11 | public class I18n 12 | { 13 | public string longDescription; 14 | public string officialSiteURL; 15 | public string gameForumURL; 16 | public string displayName; 17 | public string packArtSmall; 18 | public string packArtMedium; 19 | public string packArtLarge; 20 | public string gameManualURL; 21 | } 22 | 23 | public class Platform 24 | { 25 | public string platform; 26 | public string multiplayerId; 27 | public DateTime? releaseDate;//public DateTime releaseDate; 28 | } 29 | 30 | public string offerId; 31 | public string offerType; 32 | public string masterTitleId; 33 | public string masterTitle; 34 | public List platforms; 35 | public string publisherFacetKey; 36 | public string developerFacetKey; 37 | public string genreFacetKey; 38 | public string imageServer; 39 | public string itemName; 40 | public string itemType; 41 | public string itemId; 42 | public I18n i18n; 43 | public string offerPath; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CommonPluginsShared/Paths.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Text; 6 | 7 | namespace CommonPluginsShared 8 | { 9 | public class Paths 10 | { 11 | public static string GetSafePath(string path, bool lastIsName = false) 12 | { 13 | string pathReturn = string.Empty; 14 | List PathFolders = path.Split('\\').ToList(); 15 | foreach (string folder in PathFolders) 16 | { 17 | if (pathReturn.IsNullOrEmpty()) 18 | { 19 | pathReturn += folder; 20 | } 21 | else 22 | { 23 | if (PathFolders.IndexOf(folder) == PathFolders.Count - 1 && lastIsName) 24 | { 25 | pathReturn += "\\" + Paths.GetSafePathName(folder, false); 26 | } 27 | else 28 | { 29 | pathReturn += "\\" + Paths.GetSafePathName(folder, true); 30 | } 31 | } 32 | } 33 | 34 | return pathReturn; 35 | } 36 | 37 | public static string GetSafePathName(string filename, bool keepNameSpace = false) 38 | { 39 | return keepNameSpace 40 | ? string.Join(" ", filename.Split(Path.GetInvalidFileNameChars())).Trim() 41 | : CommonPlayniteShared.Common.Paths.GetSafePathName(filename); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CommonPluginsControls/Stores/Gog/PanelViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using CommonPluginsStores; 9 | using CommonPluginsStores.Models; 10 | using CommonPluginsStores.Models.Enumerations; 11 | using CommonPluginsStores.Models.Interfaces; 12 | using Playnite.SDK; 13 | 14 | namespace CommonPluginsControls.Stores.Gog 15 | { 16 | public class PanelViewModel : ObservableObject 17 | { 18 | internal IStoreApi StoreApi { get; set; } 19 | public AccountInfos User => StoreApi?.CurrentAccountInfos; 20 | 21 | private bool useAuth = true; 22 | public bool UseAuth { get => useAuth; set => SetValue(ref useAuth, value); } 23 | 24 | private bool forceAuth = false; 25 | public bool ForceAuth { get => forceAuth; set => SetValue(ref forceAuth, value); } 26 | 27 | public AuthStatus AuthStatus => StoreApi == null ? AuthStatus.Failed : StoreApi.IsUserLoggedIn ? AuthStatus.Ok : AuthStatus.AuthRequired; 28 | 29 | public RelayCommand LoginCommand => new RelayCommand((a) => 30 | { 31 | StoreApi.Login(); 32 | OnPropertyChanged(nameof(AuthStatus)); 33 | OnPropertyChanged(nameof(User)); 34 | }); 35 | 36 | public void ResetIsUserLoggedIn() 37 | { 38 | StoreApi.ResetIsUserLoggedIn(); 39 | OnPropertyChanged(nameof(AuthStatus)); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/GameTrophy.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class GameTrophy 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("game_id")] 16 | public int GameId { get; set; } 17 | 18 | [SerializationPropertyName("difficulty")] 19 | public int Difficulty { get; set; } 20 | 21 | [SerializationPropertyName("title")] 22 | public string Title { get; set; } 23 | 24 | [SerializationPropertyName("description")] 25 | public string Description { get; set; } 26 | 27 | [SerializationPropertyName("secret")] 28 | public bool Secret { get; set; } 29 | 30 | [SerializationPropertyName("visible")] 31 | public bool Visible { get; set; } 32 | 33 | [SerializationPropertyName("sort")] 34 | public int Sort { get; set; } 35 | 36 | [SerializationPropertyName("experience")] 37 | public int Experience { get; set; } 38 | 39 | [SerializationPropertyName("img_thumbnail")] 40 | public string ImgThumbnail { get; set; } 41 | 42 | [SerializationPropertyName("has_thumbnail")] 43 | public bool HasThumbnail { get; set; } 44 | 45 | [SerializationPropertyName("is_owner")] 46 | public bool IsOwner { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CommonPluginsControls/Stores/GameJolt/PanelViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using CommonPluginsStores; 9 | using CommonPluginsStores.Models; 10 | using CommonPluginsStores.Models.Enumerations; 11 | using CommonPluginsStores.Models.Interfaces; 12 | using Playnite.SDK; 13 | 14 | namespace CommonPluginsControls.Stores.GameJolt 15 | { 16 | public class PanelViewModel : ObservableObject 17 | { 18 | internal IStoreApi StoreApi { get; set; } 19 | public AccountInfos User => StoreApi?.CurrentAccountInfos; 20 | 21 | private bool useAuth = true; 22 | public bool UseAuth { get => useAuth; set => SetValue(ref useAuth, value); } 23 | 24 | private bool forceAuth = false; 25 | public bool ForceAuth { get => forceAuth; set => SetValue(ref forceAuth, value); } 26 | 27 | public AuthStatus AuthStatus => StoreApi == null ? AuthStatus.Failed : StoreApi.IsUserLoggedIn ? AuthStatus.Ok : AuthStatus.AuthRequired; 28 | 29 | public RelayCommand LoginCommand => new RelayCommand((a) => 30 | { 31 | StoreApi.Login(); 32 | OnPropertyChanged(nameof(AuthStatus)); 33 | OnPropertyChanged(nameof(User)); 34 | }); 35 | 36 | public void ResetIsUserLoggedIn() 37 | { 38 | StoreApi.ResetIsUserLoggedIn(); 39 | OnPropertyChanged(nameof(AuthStatus)); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CommonPluginsStores/GameJolt/Models/Ressource.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPluginsStores.GameJolt.Models 9 | { 10 | public class Resource 11 | { 12 | [SerializationPropertyName("id")] 13 | public int Id { get; set; } 14 | 15 | [SerializationPropertyName("game_id")] 16 | public int GameId { get; set; } 17 | 18 | [SerializationPropertyName("title")] 19 | public string Title { get; set; } 20 | 21 | [SerializationPropertyName("description")] 22 | public object Description { get; set; } 23 | 24 | [SerializationPropertyName("sort")] 25 | public int Sort { get; set; } 26 | 27 | [SerializationPropertyName("added_on")] 28 | public long AddedOn { get; set; } 29 | 30 | [SerializationPropertyName("published_on")] 31 | public long PublishedOn { get; set; } 32 | 33 | [SerializationPropertyName("updated_on")] 34 | public long UpdatedOn { get; set; } 35 | 36 | [SerializationPropertyName("visibility")] 37 | public string Visibility { get; set; } 38 | 39 | [SerializationPropertyName("partner_visibility")] 40 | public object PartnerVisibility { get; set; } 41 | 42 | [SerializationPropertyName("status")] 43 | public string Status { get; set; } 44 | 45 | [SerializationPropertyName("game")] 46 | public Game Game { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CommonPluginsControls/LiveChartsCommon/CustomerToolTipForMultipleSingle.xaml.cs: -------------------------------------------------------------------------------- 1 | using LiveCharts; 2 | using LiveCharts.Wpf; 3 | using System.ComponentModel; 4 | 5 | 6 | namespace CommonPluginsControls.LiveChartsCommon 7 | { 8 | /// 9 | /// Logique d'interaction pour CustomerForMultipleSingle.xaml 10 | /// 11 | public partial class CustomerToolTipForMultipleSingle : IChartTooltip 12 | { 13 | public TooltipSelectionMode? SelectionMode { get; set; } 14 | public event PropertyChangedEventHandler PropertyChanged; 15 | 16 | 17 | #region Properties 18 | private TooltipData _data; 19 | public TooltipData Data 20 | { 21 | get 22 | { 23 | return _data; 24 | } 25 | set 26 | { 27 | _data = value; 28 | OnPropertyChanged("Data"); 29 | } 30 | } 31 | #endregion 32 | 33 | 34 | protected virtual void OnPropertyChanged(string propertyName = null) 35 | { 36 | if (PropertyChanged != null) 37 | { 38 | PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); 39 | } 40 | } 41 | 42 | 43 | public CustomerToolTipForMultipleSingle() 44 | { 45 | InitializeComponent(); 46 | 47 | //LiveCharts will inject the tooltip data in the Data property 48 | //your job is only to display this data as required 49 | 50 | DataContext = this; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/LocalDateTimeConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class LocalDateTimeConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value != null && (DateTime)value != default) 24 | { 25 | DateTime dt = ((DateTime)value).ToLocalTime(); 26 | return dt.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern) + " " + dt.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern); 27 | } 28 | else 29 | { 30 | return string.Empty; 31 | } 32 | } 33 | catch (Exception ex) 34 | { 35 | Common.LogError(ex, false); 36 | return string.Empty; 37 | } 38 | } 39 | 40 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 41 | { 42 | throw new NotImplementedException(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/Hyperlink.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Native/Winnt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace CommonPlayniteShared.Native 9 | { 10 | public static class Winnt 11 | { 12 | public const uint FILE_READ_EA = 0x0008; 13 | 14 | public const uint FILE_ATTRIBUTE_READONLY = 0x00000001; 15 | public const uint FILE_ATTRIBUTE_HIDDEN = 0x00000002; 16 | public const uint FILE_ATTRIBUTE_SYSTEM = 0x00000004; 17 | public const uint FILE_ATTRIBUTE_DIRECTORY = 0x00000010; 18 | public const uint FILE_ATTRIBUTE_ARCHIVE = 0x00000020; 19 | public const uint FILE_ATTRIBUTE_DEVICE = 0x00000040; 20 | public const uint FILE_ATTRIBUTE_NORMAL = 0x00000080; 21 | public const uint FILE_ATTRIBUTE_TEMPORARY = 0x00000100; 22 | public const uint FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200; 23 | public const uint FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400; 24 | public const uint FILE_ATTRIBUTE_COMPRESSED = 0x00000800; 25 | public const uint FILE_ATTRIBUTE_OFFLINE = 0x00001000; 26 | public const uint FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000; 27 | public const uint FILE_ATTRIBUTE_ENCRYPTED = 0x00004000; 28 | public const uint FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x400000; 29 | public const uint FILE_ATTRIBUTE_RECALL_ON_OPEN = 0x40000; 30 | } 31 | 32 | [StructLayout(LayoutKind.Sequential)] 33 | public struct LUID 34 | { 35 | public uint LowPart; 36 | public int HighPart; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CommonPluginsStores/Ea/Models/Query/ResponseIdentity.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Ea.Models.Query 7 | { 8 | public class ResponseIdentity 9 | { 10 | [SerializationPropertyName("data")] 11 | public DataIdentity Data { get; set; } 12 | } 13 | public class DataIdentity 14 | { 15 | [SerializationPropertyName("me")] 16 | public MeIdentity Me { get; set; } 17 | } 18 | 19 | public class MeIdentity 20 | { 21 | [SerializationPropertyName("player")] 22 | public Player Player { get; set; } 23 | } 24 | 25 | public class Avatar 26 | { 27 | [SerializationPropertyName("medium")] 28 | public Medium Medium { get; set; } 29 | } 30 | 31 | public class Medium 32 | { 33 | [SerializationPropertyName("path")] 34 | public string Path { get; set; } 35 | } 36 | 37 | public class Player 38 | { 39 | [SerializationPropertyName("pd")] 40 | public string Pd { get; set; } 41 | 42 | [SerializationPropertyName("psd")] 43 | public string Psd { get; set; } 44 | 45 | [SerializationPropertyName("displayName")] 46 | public string DisplayName { get; set; } 47 | 48 | [SerializationPropertyName("uniqueName")] 49 | public string UniqueName { get; set; } 50 | 51 | [SerializationPropertyName("nickname")] 52 | public string Nickname { get; set; } 53 | 54 | [SerializationPropertyName("avatar")] 55 | public Avatar Avatar { get; set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/VisibilityZeroConverter.cs: -------------------------------------------------------------------------------- 1 | using CommonPlayniteShared; 2 | using Playnite.SDK; 3 | using System; 4 | using System.Drawing.Imaging; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | using System.Windows; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | using System.Windows.Media.Imaging; 14 | 15 | namespace CommonPluginsShared.Converters 16 | { 17 | public class VisibilityZeroConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | try 22 | { 23 | if (value.ToString() == "0") 24 | { 25 | if (parameter.ToString() == "1") 26 | { 27 | return Visibility.Collapsed; 28 | } 29 | else 30 | { 31 | return Visibility.Hidden; 32 | } 33 | } 34 | else 35 | { 36 | return Visibility.Visible; 37 | } 38 | } 39 | catch (Exception ex) 40 | { 41 | Common.LogError(ex, false); 42 | return Visibility.Visible; 43 | } 44 | } 45 | 46 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 47 | { 48 | throw new NotSupportedException(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Common/Extensions/Enums.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace System 11 | { 12 | public static class EnumExtensions 13 | { 14 | public static int GetMax(this Enum source) 15 | { 16 | return Enum.GetValues(source.GetType()).Cast().Max(); 17 | } 18 | public static int GetMin(this Enum source) 19 | { 20 | return Enum.GetValues(source.GetType()).Cast().Min(); 21 | } 22 | 23 | public static string GetDescription(this Enum source) 24 | { 25 | FieldInfo field = source.GetType().GetField(source.ToString()); 26 | if (field == null) 27 | { 28 | return string.Empty; 29 | } 30 | 31 | var attributes = (DescriptionAttribute[])field.GetCustomAttributes(typeof(DescriptionAttribute), false); 32 | if (attributes != null && attributes.Length > 0) 33 | { 34 | var desc = attributes[0].Description; 35 | if (desc.StartsWith("LOC", StringComparison.Ordinal)) 36 | { 37 | return ResourceProvider.GetString(desc); 38 | } 39 | else 40 | { 41 | return attributes[0].Description; 42 | } 43 | } 44 | else 45 | { 46 | return source.ToString(); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /CommonPluginsControls/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("CommonPluginsControls")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CommonPluginsControls")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("9acfa07b-718c-4546-ac27-a9fce42f61f7")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CommonPluginsResources/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("CommonPluginsResources")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CommonPluginsRessources")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("4effe926-9c64-4750-a399-f344710edc09")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/PriceResult.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace CommonPluginsStores.Gog.Models 6 | { 7 | public class PriceResult 8 | { 9 | [SerializationPropertyName("items")] 10 | public List Items { get; set; } 11 | } 12 | 13 | public class PriceCurrency 14 | { 15 | [SerializationPropertyName("code")] 16 | public string Code { get; set; } 17 | } 18 | 19 | public class Price 20 | { 21 | [SerializationPropertyName("currency")] 22 | public PriceCurrency Currency { get; set; } 23 | 24 | [SerializationPropertyName("basePrice")] 25 | public string BasePrice { get; set; } 26 | 27 | [SerializationPropertyName("finalPrice")] 28 | public string FinalPrice { get; set; } 29 | 30 | [SerializationPropertyName("bonusWalletFunds")] 31 | public string BonusWalletFunds { get; set; } 32 | } 33 | 34 | public class PriceProduct 35 | { 36 | [SerializationPropertyName("id")] 37 | public int Id { get; set; } 38 | } 39 | 40 | public class PriceEmbedded 41 | { 42 | [SerializationPropertyName("prices")] 43 | public List Prices { get; set; } 44 | 45 | [SerializationPropertyName("product")] 46 | public PriceProduct Product { get; set; } 47 | } 48 | 49 | public class PriceItem 50 | { 51 | [SerializationPropertyName("_links")] 52 | public Links Links { get; set; } 53 | 54 | [SerializationPropertyName("_embedded")] 55 | public PriceEmbedded Embedded { get; set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Converters/StringNullOrEmptyToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Data; 8 | using System.Windows.Markup; 9 | 10 | namespace CommonPlayniteShared.Converters 11 | { 12 | public class StringNullOrEmptyToVisibilityConverter : MarkupExtension, IValueConverter 13 | { 14 | enum Parameters 15 | { 16 | Normal, Inverted 17 | } 18 | 19 | public static StringNullOrEmptyToVisibilityConverter Instance { get; } = new StringNullOrEmptyToVisibilityConverter(); 20 | 21 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 22 | { 23 | var direction = parameter == null ? Parameters.Normal : (Parameters)Enum.Parse(typeof(Parameters), (string)parameter); 24 | if (direction == Parameters.Inverted) 25 | { 26 | return string.IsNullOrEmpty(value as string) ? Visibility.Visible : Visibility.Collapsed; 27 | } 28 | else 29 | { 30 | return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible; 31 | } 32 | } 33 | 34 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 35 | { 36 | return new NotSupportedException(); 37 | } 38 | 39 | public override object ProvideValue(IServiceProvider serviceProvider) 40 | { 41 | return this; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamOwnedGames.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class SteamOwnedGames 9 | { 10 | [SerializationPropertyName("game_count")] 11 | public int GameCount { get; set; } 12 | 13 | [SerializationPropertyName("games")] 14 | public List Games { get; set; } 15 | } 16 | 17 | public class SteamGame 18 | { 19 | [SerializationPropertyName("appid")] 20 | public uint AppId { get; set; } 21 | 22 | [SerializationPropertyName("name")] 23 | public string Name { get; set; } 24 | 25 | [SerializationPropertyName("playtime_forever")] 26 | public int PlaytimeForever { get; set; } 27 | 28 | [SerializationPropertyName("img_icon_url")] 29 | public string ImgIconUrl { get; set; } 30 | 31 | [SerializationPropertyName("capsule_filename")] 32 | public string CapsuleFilename { get; set; } 33 | 34 | [SerializationPropertyName("sort_as")] 35 | public string SortAs { get; set; } 36 | 37 | [SerializationPropertyName("has_workshop")] 38 | public bool HasWorkshop { get; set; } 39 | 40 | [SerializationPropertyName("has_market")] 41 | public bool HasMarket { get; set; } 42 | 43 | [SerializationPropertyName("has_dlc")] 44 | public bool HasDlc { get; set; } 45 | 46 | [SerializationPropertyName("content_descriptorids")] 47 | public List ContentDescriptorids { get; set; } 48 | 49 | [SerializationPropertyName("has_community_visible_stats")] 50 | public bool? HasCommunityVisibleStats { get; set; } 51 | 52 | [SerializationPropertyName("has_leaderboards")] 53 | public bool? HasLeaderboards { get; set; } 54 | } 55 | } -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/OriginLibrary/Models/GameLocalDataResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.OriginLibrary.Models 8 | { 9 | public class GameLocalDataResponse 10 | { 11 | public class LocalizableAttributes 12 | { 13 | public string longDescription; 14 | public string displayName; 15 | } 16 | 17 | public class I18n 18 | { 19 | public string longDescription; 20 | public string displayName; 21 | } 22 | 23 | public class Publishing 24 | { 25 | public class Software 26 | { 27 | public class FulfillmentAttributes 28 | { 29 | public string executePathOverride; 30 | public string installationDirectory; 31 | public string installCheckOverride; 32 | } 33 | 34 | public string softwareId; 35 | public string softwarePlatform; 36 | public FulfillmentAttributes fulfillmentAttributes; 37 | } 38 | 39 | public class SoftwareList 40 | { 41 | public List software; 42 | } 43 | 44 | public SoftwareList softwareList; 45 | } 46 | 47 | public string offerId; 48 | public string offerType; 49 | public Publishing publishing; 50 | public LocalizableAttributes localizableAttributes; 51 | public I18n i18n; 52 | public string itemName; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/EpicLibrary/Models/LauncherInstalled.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.EpicLibrary.Models 8 | { 9 | public class LauncherInstalled 10 | { 11 | public class InstalledApp 12 | { 13 | public string InstallLocation; 14 | public string AppName; 15 | public long AppID; 16 | public string AppVersion; 17 | } 18 | 19 | public List InstallationList; 20 | } 21 | 22 | public class InstalledManifiest 23 | { 24 | public string LaunchCommand; 25 | public string LaunchExecutable; 26 | public string ManifestLocation; 27 | public bool bIsApplication; 28 | public bool bIsExecutable; 29 | public bool bRequiresAuth; 30 | public bool bCanRunOffline; 31 | public string AppName; 32 | public string CatalogNamespace; 33 | public List AppCategories; 34 | public string DisplayName; 35 | public string FullAppName; 36 | public string InstallationGuid; 37 | public string InstallLocation; 38 | public string InstallSessionId; 39 | public string StagingLocation; 40 | public string TechnicalType; 41 | public string VaultThumbnailUrl; 42 | public string VaultTitleText; 43 | public string InstallSize; 44 | public string MainWindowProcessName; 45 | public List ProcessNames; 46 | public string MainGameAppName; 47 | public string MandatoryAppFolderName; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CommonPlayniteShared/PluginLibrary/GogLibrary/Models/ProductApiDetail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CommonPlayniteShared.PluginLibrary.GogLibrary.Models 8 | { 9 | public class ProductApiDetail 10 | { 11 | public class Compatibility 12 | { 13 | public bool windows; 14 | public bool osx; 15 | public bool linux; 16 | } 17 | 18 | public class Links 19 | { 20 | public string purchase_link; 21 | public string product_card; 22 | public string support; 23 | public string forum; 24 | } 25 | 26 | public class Images 27 | { 28 | public string background; 29 | public string logo; 30 | public string logo2x; 31 | public string icon; 32 | public string sidebarIcon; 33 | public string sidebarIcon2x; 34 | } 35 | 36 | public class Description 37 | { 38 | public string lead; 39 | public string full; 40 | public string whats_cool_about_it; 41 | } 42 | 43 | public int id; 44 | public string title; 45 | public string slug; 46 | public Compatibility content_system_compatibility; 47 | public Dictionary languages; 48 | public Links links; 49 | public bool is_secret; 50 | public string game_type; 51 | public bool is_pre_order; 52 | public Images images; 53 | public Description description; 54 | public DateTime? release_date; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/DockToStringConverter.cs: -------------------------------------------------------------------------------- 1 | using Playnite; 2 | using Playnite.SDK; 3 | //using Playnite.Settings; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Controls; 10 | using System.Windows.Data; 11 | using System.Windows.Markup; 12 | using System.Windows.Media; 13 | 14 | namespace CommonPluginsShared.Converters 15 | { 16 | public class DockToStringConverter : MarkupExtension, IValueConverter 17 | { 18 | public static string GetString(Dock value) 19 | { 20 | switch (value) 21 | { 22 | case Dock.Left: 23 | return ResourceProvider.GetString("LOCDockLeft"); 24 | case Dock.Right: 25 | return ResourceProvider.GetString("LOCDockRight"); 26 | case Dock.Top: 27 | return ResourceProvider.GetString("LOCDockTop"); 28 | case Dock.Bottom: 29 | return ResourceProvider.GetString("LOCDockBottom"); 30 | } 31 | 32 | return ""; 33 | } 34 | 35 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 36 | { 37 | return GetString((Dock)value); 38 | } 39 | 40 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 41 | { 42 | return new NotSupportedException(); 43 | } 44 | 45 | public override object ProvideValue(IServiceProvider serviceProvider) 46 | { 47 | return this; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /CommonPluginsShared/Converters/GetMediaTypeConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Windows.Data; 5 | 6 | namespace CommonPluginsShared.Converters 7 | { 8 | public class GetMediaTypeConverter : IValueConverter 9 | { 10 | private static readonly HashSet VideoExtensions = new HashSet 11 | { 12 | ".mkv", ".mp4", ".avi", ".webm" 13 | }; 14 | 15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | try 18 | { 19 | var strValue = value as string; 20 | if (!string.IsNullOrEmpty(strValue)) 21 | { 22 | var ext = System.IO.Path.GetExtension(strValue)?.ToLowerInvariant(); 23 | if (string.IsNullOrEmpty(ext)) 24 | { 25 | return "\ueb16"; 26 | } 27 | 28 | if (VideoExtensions.Contains(ext)) 29 | { 30 | return "\ueb13"; 31 | } 32 | if (ext == ".webp") 33 | { 34 | return "\ueb16 \ueb13"; 35 | } 36 | 37 | return "\ueb16"; 38 | } 39 | } 40 | catch (Exception ex) 41 | { 42 | Common.LogError(ex, false); 43 | } 44 | 45 | return string.Empty; 46 | } 47 | 48 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 49 | { 50 | throw new NotSupportedException(); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/DefaultControls/ContextMenu.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 27 | -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/ProfileGames.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace CommonPluginsStores.Gog.Models 6 | { 7 | public class ProfileGames 8 | { 9 | [SerializationPropertyName("page")] 10 | public int Page { get; set; } 11 | 12 | [SerializationPropertyName("limit")] 13 | public int Limit { get; set; } 14 | 15 | [SerializationPropertyName("pages")] 16 | public int Pages { get; set; } 17 | 18 | [SerializationPropertyName("total")] 19 | public int Total { get; set; } 20 | 21 | [SerializationPropertyName("_links")] 22 | public Links Links { get; set; } 23 | 24 | [SerializationPropertyName("_embedded")] 25 | public Embedded Embedded { get; set; } 26 | } 27 | 28 | public class Game 29 | { 30 | [SerializationPropertyName("id")] 31 | public string Id { get; set; } 32 | 33 | [SerializationPropertyName("title")] 34 | public string Title { get; set; } 35 | 36 | [SerializationPropertyName("url")] 37 | public string Url { get; set; } 38 | 39 | [SerializationPropertyName("achievementSupport")] 40 | public bool AchievementSupport { get; set; } 41 | 42 | [SerializationPropertyName("image")] 43 | public string Image { get; set; } 44 | } 45 | 46 | public class GameItem 47 | { 48 | [SerializationPropertyName("game")] 49 | public Game Game { get; set; } 50 | 51 | [SerializationPropertyName("stats")] 52 | public object Stats { get; set; } 53 | } 54 | 55 | public class Embedded 56 | { 57 | [SerializationPropertyName("items")] 58 | public List Items { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Settings/PlayniteSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | //using Newtonsoft.Json; 10 | //using NLog; 11 | //using NLog.Config; 12 | //using NLog.Targets; 13 | using System.Configuration; 14 | using CommonPlayniteShared.Common;//using Playnite.Common; 15 | using System.Runtime.CompilerServices; 16 | using System.Windows.Controls; 17 | using System.Windows.Media; 18 | using System.Windows; 19 | //using Newtonsoft.Json.Serialization; 20 | using System.Runtime.Serialization; 21 | //using Playnite.Metadata; 22 | using Playnite.SDK; 23 | using Microsoft.Win32; 24 | using Playnite.SDK.Models; 25 | using System.Collections.ObjectModel; 26 | using Playnite.SDK.Plugins; 27 | 28 | namespace CommonPlayniteShared 29 | { 30 | public enum ImageLoadScaling 31 | { 32 | //[Description(LOC.SettingsImageScalingQuality)] 33 | None, 34 | //[Description(LOC.SettingsImageScalingBalanced)] 35 | BitmapDotNet, 36 | //[Description(LOC.SettingsImageScalingAlternative)] 37 | Custom 38 | } 39 | 40 | public class PlayniteSettings : ObservableObject 41 | { 42 | public static bool IsPortable 43 | { 44 | get 45 | { 46 | return !File.Exists(PlaynitePaths.UninstallerPath); 47 | } 48 | } 49 | 50 | private string directoryOpenCommand; 51 | public string DirectoryOpenCommand 52 | { 53 | get => directoryOpenCommand; 54 | set 55 | { 56 | directoryOpenCommand = value; 57 | OnPropertyChanged(); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /CommonPluginsControls/Stores/Epic/PanelViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using CommonPluginsStores; 9 | using CommonPluginsStores.Models; 10 | using CommonPluginsStores.Models.Enumerations; 11 | using CommonPluginsStores.Models.Interfaces; 12 | using Playnite.SDK; 13 | 14 | namespace CommonPluginsControls.Stores.Epic 15 | { 16 | public class PanelViewModel : ObservableObject 17 | { 18 | internal IStoreApi StoreApi { get; set; } 19 | public AccountInfos User => StoreApi?.CurrentAccountInfos; 20 | 21 | private bool useAuth = true; 22 | public bool UseAuth { get => useAuth; set => SetValue(ref useAuth, value); } 23 | 24 | private bool forceAuth = false; 25 | public bool ForceAuth { get => forceAuth; set => SetValue(ref forceAuth, value); } 26 | 27 | public AuthStatus AuthStatus => StoreApi == null ? AuthStatus.Failed : StoreApi.IsUserLoggedIn ? AuthStatus.Ok : AuthStatus.AuthRequired; 28 | 29 | public RelayCommand LoginCommand => new RelayCommand((a) => 30 | { 31 | StoreApi.Login(); 32 | OnPropertyChanged(nameof(AuthStatus)); 33 | OnPropertyChanged(nameof(User)); 34 | }); 35 | 36 | public RelayCommand LoginAlternativeCommand => new RelayCommand((a) => 37 | { 38 | StoreApi.LoginAlternative(); 39 | OnPropertyChanged(nameof(AuthStatus)); 40 | OnPropertyChanged(nameof(User)); 41 | }); 42 | 43 | public void ResetIsUserLoggedIn() 44 | { 45 | StoreApi.ResetIsUserLoggedIn(); 46 | OnPropertyChanged(nameof(AuthStatus)); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CommonPluginsStores/Models/Interfaces/IStoreApi.cs: -------------------------------------------------------------------------------- 1 | namespace CommonPluginsStores.Models.Interfaces 2 | { 3 | /// 4 | /// Represents the API contract for a store plugin. 5 | /// 6 | public interface IStoreApi 7 | { 8 | /// 9 | /// Gets or sets the store settings. 10 | /// 11 | StoreSettings StoreSettings { get; set; } 12 | 13 | /// 14 | /// Gets or sets whether the user is logged in. 15 | /// 16 | bool IsUserLoggedIn { get; set; } 17 | 18 | /// 19 | /// Gets or sets the current account information. 20 | /// 21 | AccountInfos CurrentAccountInfos { get; set; } 22 | 23 | /// 24 | /// Resets the user login status. 25 | /// 26 | void ResetIsUserLoggedIn(); 27 | 28 | /// 29 | /// Sets the language or locale used by the store API. 30 | /// 31 | /// The locale code, e.g., 'en-US'. 32 | void SetLanguage(string locale); 33 | 34 | /// 35 | /// Performs the main login procedure. 36 | /// 37 | void Login(); 38 | 39 | /// 40 | /// Performs an alternative login procedure. 41 | /// 42 | void LoginAlternative(); 43 | } 44 | 45 | internal interface IStoreApiInternal 46 | { 47 | /// 48 | /// Loads the current user information. 49 | /// 50 | /// The loaded account information. 51 | AccountInfos LoadCurrentUser(); 52 | 53 | /// 54 | /// Saves the current user information. 55 | /// 56 | void SaveCurrentUser(); 57 | } 58 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Gog/Models/AccountBasicResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Playnite.SDK.Data; 5 | 6 | namespace CommonPluginsStores.Gog.Models 7 | { 8 | public class AccountBasicResponse 9 | { 10 | [SerializationPropertyName("isLoggedIn")] 11 | public bool IsLoggedIn { get; set; } 12 | 13 | [SerializationPropertyName("userId")] 14 | public string UserId { get; set; } 15 | 16 | [SerializationPropertyName("accessToken")] 17 | public string AccessToken { get; set; } 18 | 19 | [SerializationPropertyName("accessTokenExpires")] 20 | public int AccessTokenExpires { get; set; } 21 | 22 | [SerializationPropertyName("clientId")] 23 | public string ClientId { get; set; } 24 | 25 | [SerializationPropertyName("username")] 26 | public string Username { get; set; } 27 | 28 | [SerializationPropertyName("avatars")] 29 | public Avatars Avatars { get; set; } 30 | 31 | [SerializationPropertyName("avatar")] 32 | public string Avatar { get; set; } 33 | 34 | [SerializationPropertyName("profileState")] 35 | public string ProfileState { get; set; } 36 | 37 | [SerializationPropertyName("cacheExpires")] 38 | public int CacheExpires { get; set; } 39 | } 40 | 41 | public class Avatars 42 | { 43 | [SerializationPropertyName("menu_user_av_small")] 44 | public string MenuUserAvSmall { get; set; } 45 | 46 | [SerializationPropertyName("menu_user_av_small2")] 47 | public string MenuUserAvSmall2 { get; set; } 48 | 49 | [SerializationPropertyName("menu_user_av_big")] 50 | public string MenuUserAvBig { get; set; } 51 | 52 | [SerializationPropertyName("menu_user_av_big2")] 53 | public string MenuUserAvBig2 { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/AmazonLocSource.xaml: -------------------------------------------------------------------------------- 1 | 2 | Import installed games 3 | Import not installed games 4 | Connect account 5 | Checking authentication status… 6 | User is authenticated 7 | Requires authentication 8 | Failed to authenticate user. 9 | Authenticate 10 | Start games directly without running official client 11 | Troubleshooting account sync issues 12 | Troubleshooting issues 13 | Import all games 14 | Private Account 15 | Public Account 16 | API Key 17 | Start using {0} client 18 | Import play time 19 | Account ID 20 | Metadata language: 21 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/OriginLocSource.xaml: -------------------------------------------------------------------------------- 1 | 2 | Import installed games 3 | Import not installed games 4 | Connect account 5 | Checking authentication status… 6 | User is authenticated 7 | Requires authentication 8 | Failed to authenticate user. 9 | Authenticate 10 | Start games directly without running official client 11 | Troubleshooting account sync issues 12 | Troubleshooting issues 13 | Import all games 14 | Private Account 15 | Public Account 16 | API Key 17 | Start using {0} client 18 | Import play time 19 | Account ID 20 | Metadata language: 21 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/UplayLocSource.xaml: -------------------------------------------------------------------------------- 1 | 2 | Import installed games 3 | Import not installed games 4 | Connect account 5 | Checking authentication status… 6 | User is authenticated 7 | Requires authentication 8 | Failed to authenticate user. 9 | Authenticate 10 | Start games directly without running official client 11 | Troubleshooting account sync issues 12 | Troubleshooting issues 13 | Import all games 14 | Private Account 15 | Public Account 16 | API Key 17 | Start using {0} client 18 | Import play time 19 | Account ID 20 | Metadata language: 21 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/Common.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | 19 | 29 | 30 | 35 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/RockstarLibrary.xaml: -------------------------------------------------------------------------------- 1 | 2 | Import installed games 3 | Import not installed games 4 | Connect account 5 | Checking authentication status… 6 | User is authenticated 7 | Requires authentication 8 | Failed to authenticate user. 9 | Authenticate 10 | Start games directly without running official client 11 | Troubleshooting account sync issues 12 | Troubleshooting issues 13 | Import all games 14 | Private Account 15 | Public Account 16 | API Key 17 | Start using {0} client 18 | Import play time 19 | Account ID 20 | Metadata language: 21 | -------------------------------------------------------------------------------- /PluginCommon.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5B1D1EDA-8BA6-436D-BA9F-F6A7BBC1AB7D} 8 | Exe 9 | PluginCommon 10 | PluginCommon 11 | v4.6.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CommonPlayniteShared/Behaviors/MediaElementBehaviors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | 10 | namespace CommonPlayniteShared.Behaviors 11 | { 12 | public class MediaElementBehaviors 13 | { 14 | private static readonly DependencyProperty RepeatProperty = 15 | DependencyProperty.RegisterAttached( 16 | "Repeat", 17 | typeof(bool), 18 | typeof(MediaElementBehaviors), 19 | new PropertyMetadata(new PropertyChangedCallback(RepeatPropertyChanged))); 20 | 21 | public static bool GetRepeat(DependencyObject obj) 22 | { 23 | return (bool)obj.GetValue(RepeatProperty); 24 | } 25 | 26 | public static void SetRepeat(DependencyObject obj, bool value) 27 | { 28 | obj.SetValue(RepeatProperty, value); 29 | } 30 | 31 | private static void RepeatPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) 32 | { 33 | if (DesignerProperties.GetIsInDesignMode(obj)) 34 | { 35 | return; 36 | } 37 | 38 | var media = (MediaElement)obj; 39 | if ((bool)args.NewValue) 40 | { 41 | media.UnloadedBehavior = MediaState.Manual; 42 | media.MediaEnded += Control_MediaEnded; 43 | } 44 | else 45 | { 46 | media.MediaEnded -= Control_MediaEnded; 47 | } 48 | } 49 | 50 | private static void Control_MediaEnded(object sender, RoutedEventArgs e) 51 | { 52 | Console.WriteLine("restert"); 53 | var media = (MediaElement)sender; 54 | media.Position = TimeSpan.Zero; 55 | media.Play(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /CommonPluginsResources/ResourcesPlaynite/BattleNetLocSource.xaml: -------------------------------------------------------------------------------- 1 | 2 | Import installed games 3 | Import not installed games 4 | Connect account 5 | Checking authentication status… 6 | User is authenticated 7 | Requires authentication 8 | Failed to authenticate user. 9 | Authenticate 10 | Start games directly without running official client 11 | Troubleshooting account sync issues 12 | Troubleshooting issues 13 | Import all games 14 | Private Account 15 | Public Account 16 | API Key 17 | Start using {0} client 18 | Import play time 19 | Account ID 20 | Metadata language: 21 | -------------------------------------------------------------------------------- /CommonPluginsShared/CommonPluginsShared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 27e5d35b-f3ce-4a3f-9705-4564674615a5 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /CommonPluginsShared/Commands.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Text; 6 | using System.Windows; 7 | 8 | namespace CommonPluginsShared 9 | { 10 | public static class Commands 11 | { 12 | [Obsolete("Use CommonPlayniteShared.Commands.NavigateUrlCommand", true)] 13 | public static RelayCommand NavigateUrl => new RelayCommand((url) => 14 | { 15 | try 16 | { 17 | if (url is string stringUrl) 18 | { 19 | Process.Start(stringUrl); 20 | } 21 | else if (url is Uri uriUrl) 22 | { 23 | Process.Start(uriUrl.AbsoluteUri); 24 | } 25 | else 26 | { 27 | throw new Exception("Unsupported URL format."); 28 | } 29 | } 30 | catch (Exception ex) 31 | { 32 | Common.LogError(ex, false, "Failed to open url."); 33 | } 34 | }); 35 | 36 | public static RelayCommand RestartRequired => new RelayCommand((sender) => 37 | { 38 | try 39 | { 40 | Window WinParent = UI.FindParent((FrameworkElement)sender); 41 | if (WinParent.DataContext?.GetType().GetProperty("IsRestartRequired") != null) 42 | { 43 | ((dynamic)WinParent.DataContext).IsRestartRequired = true; 44 | } 45 | } 46 | catch (Exception ex) 47 | { 48 | Common.LogError(ex, false); 49 | } 50 | }); 51 | 52 | public static RelayCommand GoToGame => new RelayCommand((id) => 53 | { 54 | API.Instance.MainView.SelectGame(id); 55 | API.Instance.MainView.SwitchToLibraryView(); 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /CommonPluginsControls/Views/SelectVariable.xaml.cs: -------------------------------------------------------------------------------- 1 | using CommonPluginsStores; 2 | using System.Collections.Generic; 3 | using System.Windows; 4 | using System.Linq; 5 | using System.Windows.Controls; 6 | using CommonPluginsShared.Extensions; 7 | using Playnite.SDK; 8 | using Playnite.SDK.Models; 9 | 10 | namespace CommonPluginsControls.Controls 11 | { 12 | /// 13 | /// Logique d'interaction pour SelectVariable.xaml 14 | /// 15 | public partial class SelectVariable : UserControl 16 | { 17 | public SelectVariable() 18 | { 19 | InitializeComponent(); 20 | 21 | Game game = API.Instance.Database.Games.OrderByDescending(x => x.LastActivity)?.FirstOrDefault(); 22 | 23 | List ListVariables = PlayniteTools.ListVariables; 24 | List pluginVariables = ListVariables 25 | .Select(x => new PluginVariable 26 | { 27 | Name = x, 28 | Value = x.IsEqual(PlayniteTools.StringExpandWithStores(game, x)) ? string.Empty : PlayniteTools.StringExpandWithStores(game, x) 29 | }) 30 | .ToList(); 31 | 32 | PART_ListBox.ItemsSource = pluginVariables; 33 | } 34 | 35 | 36 | private void PART_BtClose_Click(object sender, RoutedEventArgs e) 37 | { 38 | ((Window)this.Parent).Close(); 39 | } 40 | 41 | private void PART_BtCopy_Click(object sender, RoutedEventArgs e) 42 | { 43 | Clipboard.SetText(((PluginVariable)PART_ListBox.SelectedItem).Name.ToString()); 44 | ((Window)this.Parent).Close(); 45 | } 46 | 47 | 48 | private void PART_ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) 49 | { 50 | PART_BtCopy.IsEnabled = true; 51 | } 52 | } 53 | 54 | 55 | public class PluginVariable 56 | { 57 | public string Name { get; set; } 58 | public string Value { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamPlayerSummaries.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class SteamPlayer 9 | { 10 | [SerializationPropertyName("steamid")] 11 | public ulong SteamId { get; set; } 12 | [SerializationPropertyName("communityvisibilitystate")] 13 | public int CommunityVisibilityState { get; set; } 14 | [SerializationPropertyName("profilestate")] 15 | public int ProfileState { get; set; } 16 | [SerializationPropertyName("personaname")] 17 | public string PersonaName { get; set; } 18 | [SerializationPropertyName("profileurl")] 19 | public string ProfileUrl { get; set; } 20 | [SerializationPropertyName("avatar")] 21 | public string Avatar { get; set; } 22 | [SerializationPropertyName("avatarmedium")] 23 | public string AvatarMedium { get; set; } 24 | [SerializationPropertyName("avatarfull")] 25 | public string AvatarFull { get; set; } 26 | [SerializationPropertyName("avatarhash")] 27 | public string AvatarHash { get; set; } 28 | [SerializationPropertyName("lastlogoff")] 29 | public int LastLogOff { get; set; } 30 | [SerializationPropertyName("personastate")] 31 | public int PersonaState { get; set; } 32 | [SerializationPropertyName("primaryclanid")] 33 | public string PrimaryClanId { get; set; } 34 | [SerializationPropertyName("timecreated")] 35 | public int TimeCreated { get; set; } 36 | [SerializationPropertyName("personastateflags")] 37 | public int PersonaStateFlags { get; set; } 38 | [SerializationPropertyName("loccountrycode")] 39 | public string LocCountryCode { get; set; } 40 | } 41 | 42 | public class SteamPlayerSummaries 43 | { 44 | [SerializationPropertyName("players")] 45 | public List Players { get; set; } 46 | } 47 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Epic/Models/Query/QueryGetCatalogMappings.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Epic.Models.Query 7 | { 8 | public class QueryGetCatalogMappings 9 | { 10 | public string OperationName { get; set; } = "GetCatalogMappings"; 11 | public string Query { get; set; } = @" 12 | query GetCatalogMappings($Namespace: String!, $PageType: String!) { 13 | Catalog { 14 | catalogNs(namespace: $Namespace) { 15 | mappings(pageType: $PageType) { 16 | createdDate 17 | deletedDate 18 | mappings { 19 | cmsSlug 20 | offerId 21 | prePurchaseOfferId 22 | } 23 | pageSlug 24 | pageType 25 | productId 26 | sandboxId 27 | updatedDate 28 | } 29 | } 30 | } 31 | }"; 32 | public CatalogVariables Variables { get; set; } = new CatalogVariables(); 33 | } 34 | 35 | public class CatalogVariables 36 | { 37 | public string Namespace { get; set; } 38 | public string PageType { get; set; } 39 | } 40 | 41 | public class CatalogMappingsResponse 42 | { 43 | [SerializationPropertyName("data")] 44 | public CatalogData Data { get; set; } 45 | 46 | public class CatalogData 47 | { 48 | public Catalog Catalog { get; set; } 49 | } 50 | 51 | public class Catalog 52 | { 53 | [SerializationPropertyName("catalogNs")] 54 | public CatalogNs CatalogNs { get; set; } 55 | } 56 | 57 | public class CatalogNs 58 | { 59 | [SerializationPropertyName("mappings")] 60 | public List Mappings { get; set; } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /CommonPluginsStores/Steam/Models/SteamSearch.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK.Data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace CommonPluginsStores.Steam.Models 7 | { 8 | public class ItemSearch 9 | { 10 | [SerializationPropertyName("type")] 11 | public string Type { get; set; } 12 | 13 | [SerializationPropertyName("name")] 14 | public string Name { get; set; } 15 | 16 | [SerializationPropertyName("id")] 17 | public int Id { get; set; } 18 | 19 | [SerializationPropertyName("tiny_image")] 20 | public string TinyImage { get; set; } 21 | 22 | [SerializationPropertyName("metascore")] 23 | public string Metascore { get; set; } 24 | 25 | [SerializationPropertyName("platforms")] 26 | public Platforms Platforms { get; set; } 27 | 28 | [SerializationPropertyName("streamingvideo")] 29 | public bool Streamingvideo { get; set; } 30 | 31 | [SerializationPropertyName("price")] 32 | public Price Price { get; set; } 33 | } 34 | 35 | public class Platforms 36 | { 37 | [SerializationPropertyName("windows")] 38 | public bool Windows { get; set; } 39 | 40 | [SerializationPropertyName("mac")] 41 | public bool Mac { get; set; } 42 | 43 | [SerializationPropertyName("linux")] 44 | public bool Linux { get; set; } 45 | } 46 | 47 | public class Price 48 | { 49 | [SerializationPropertyName("currency")] 50 | public string Currency { get; set; } 51 | 52 | [SerializationPropertyName("initial")] 53 | public int Initial { get; set; } 54 | 55 | [SerializationPropertyName("final")] 56 | public int Final { get; set; } 57 | } 58 | 59 | public class SteamSearch 60 | { 61 | [SerializationPropertyName("total")] 62 | public int Total { get; set; } 63 | 64 | [SerializationPropertyName("items")] 65 | public List Items { get; set; } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /CommonPluginsControls/Views/ListWithNoData.xaml.cs: -------------------------------------------------------------------------------- 1 | using CommonPluginsShared.Interfaces; 2 | using Playnite.SDK; 3 | using Playnite.SDK.Models; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Windows; 8 | using System.Windows.Controls; 9 | 10 | namespace CommonPluginsControls.Views 11 | { 12 | /// 13 | /// Logique d'interaction pour ListWithNoData.xaml 14 | /// 15 | public partial class ListWithNoData : UserControl 16 | { 17 | private IPluginDatabase PluginDatabase { get; set; } 18 | private List gameData = new List(); 19 | 20 | private RelayCommand GoToGame { get; set; } 21 | 22 | public ListWithNoData(IPluginDatabase PluginDatabase) 23 | { 24 | this.PluginDatabase = PluginDatabase; 25 | 26 | InitializeComponent(); 27 | 28 | GoToGame = new RelayCommand((Id) => 29 | { 30 | API.Instance.MainView.SelectGame(Id); 31 | API.Instance.MainView.SwitchToLibraryView(); 32 | }); 33 | 34 | RefreshData(); 35 | } 36 | 37 | 38 | private void Button_Click(object sender, RoutedEventArgs e) 39 | { 40 | PluginDatabase.Refresh(gameData.Select(x => x.Id)); 41 | RefreshData(); 42 | } 43 | 44 | 45 | private void RefreshData() 46 | { 47 | ListViewGames.ItemsSource = null; 48 | IEnumerable games = PluginDatabase.GetGamesWithNoData(); 49 | gameData = games.Select(x => new GameData { Id = x.Id, Name = x.Name, GoToGame = GoToGame }).ToList(); 50 | ListViewGames.ItemsSource = gameData; 51 | 52 | PART_Count.Content = gameData.Count; 53 | 54 | ListViewGames.Sorting(); 55 | } 56 | } 57 | 58 | 59 | public class GameData 60 | { 61 | public Guid Id { get; set; } 62 | public string Name { get; set; } 63 | public RelayCommand GoToGame { get; set; } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /CommonPluginsShared/Plugins/PluginElement.cs: -------------------------------------------------------------------------------- 1 | using Playnite.SDK; 2 | using Playnite.SDK.Controls; 3 | using Playnite.SDK.Models; 4 | using Playnite.SDK.Plugins; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using static CommonPluginsShared.PlayniteTools; 10 | 11 | namespace CommonPluginsShared.Plugins 12 | { 13 | public class PluginElement 14 | { 15 | private Guid PluginId { get; } 16 | private ExternalPlugin ExternalPlugin { get; } 17 | 18 | private Plugin _plugin; 19 | private Plugin plugin 20 | { 21 | get 22 | { 23 | if (_plugin == null) 24 | { 25 | _plugin = API.Instance?.Addons?.Plugins?.FirstOrDefault(p => p.Id == PluginId) ?? null; 26 | } 27 | return _plugin; 28 | } 29 | } 30 | 31 | 32 | public PluginElement(ExternalPlugin ExternalPlugin) 33 | { 34 | this.ExternalPlugin = ExternalPlugin; 35 | this.PluginId = PlayniteTools.GetPluginId(ExternalPlugin); 36 | } 37 | 38 | 39 | public IEnumerable GetGameMenuItems(List Games) 40 | { 41 | return plugin?.GetGameMenuItems(new GetGameMenuItemsArgs { Games = Games }) ?? null; 42 | } 43 | 44 | public IEnumerable GetGameMenuItemsPurged(List Games) 45 | { 46 | IEnumerable pluginsMenus = plugin?.GetGameMenuItems(new GetGameMenuItemsArgs { Games = Games }) ?? null; 47 | if (pluginsMenus != null) 48 | { 49 | switch (ExternalPlugin) 50 | { 51 | case ExternalPlugin.SuccessStory: 52 | for (int idx = pluginsMenus.Count() - 1; idx > -1; idx--) 53 | { 54 | 55 | 56 | 57 | } 58 | break; 59 | } 60 | } 61 | return pluginsMenus; 62 | } 63 | } 64 | } 65 | --------------------------------------------------------------------------------