366 Commits

Author SHA1 Message Date
PatrickSt1991
d1078087f5 Merge branch 'beta' of https://github.com/PatrickSt1991/Samsung-Jellyfin-Installer into beta 2026-01-24 18:27:16 +01:00
PatrickSt1991
63f37a5cfa add esbuild - my bad sorry
beta build service for youtube
2026-01-24 18:23:33 +01:00
PatrickSt1991
867c7c2c6e Added default for Github Assets 2026-01-23 16:12:14 +01:00
Patrick
d59c5e42c5 stip beta tag 2026-01-22 09:23:15 +01:00
PatrickSt1991
e1b9d5b03d possible null references popping up in github action 2026-01-21 13:34:00 +01:00
PatrickSt1991
71cf3d62a8 move functions to htmlutils and filter out beta releases 2026-01-21 13:14:34 +01:00
PatrickSt1991
b36a83038f Write api response to debug log 2026-01-21 12:55:49 +01:00
PatrickSt1991
2adebebb74 Fixed DeletePreviousInstall setting
Forcefully delete previous installation if tryOverwrite is true but Author certificate mismatch
2026-01-21 08:31:01 +01:00
PatrickSt1991
6a0a6df965 Moved Jellyfin config guard up to installerService
NetworkInterfaces as selectable instead of automatic
2026-01-19 20:05:42 +01:00
kingchenc
9c38699702 Add cancellation token to stop background tasks when update dialog shows
Description

  Fixed UI freeze when update dialog appears during startup. Previously, network scanning and GitHub release loading continued running in the background while the update dialog was displayed, causing the window to freeze.

Changes:
  - Added _initializationCts to cancel initialization tasks
  - Pass cancellation token to LoadReleasesAsync() and LoadDevicesAsync()
  - Cancel background tasks before showing update dialog
  - Resume initialization after user dismisses dialog (Cancel/Skip/Manual)
  - Added cancellation check in DeviceHelper.ScanForDevicesAsync() loop
2026-01-19 13:38:51 +01:00
PatrickSt1991
36b112cd96 Added spacer to prevent youtube falling of the view 2026-01-18 20:01:52 +01:00
kingchenc
0f68d108b1 Add auto-updater with GitHub Atom feed (no rate limit)
Summary
  - Add auto-update checker using GitHub Atom feed (bypasses API rate limits)
  - Show update dialog on startup with two options: "Open Releases" (manual) or "Update Now" (automatic)
  - Automatic updates: download, extract, replace files, restart app
  - Support for Windows, Linux, and macOS

Changes
  - New services: `UpdaterService`, `UpdateDialogService`
  - New dialog: `UpdateDialog` with version info and release notes
  - New settings: `CheckForUpdatesOnStartup`, `SkippedUpdateVersion`
  - Localization: All 6 languages (EN, DE, NL, FR, DA, TR)

Technical Details
  - Uses `/releases.atom` endpoint instead of REST API (no rate limit)
  - Falls back to API only for download URLs when update is available
  - Update script handles file replacement while app is closed
  - Version comparison with semver support
2026-01-18 15:03:23 +01:00
kingchenc
a97d4dccf3 Fix for when no Theme is selected
2026-01-18 14:31:19.230 [Binding]An error occurred binding 'Text' to 'SelectedJellyTheme.Name' at 'SelectedJellyTheme': 'Value is null.' (TextBlock #11601606)
2026-01-18 14:45:36 +01:00
PatrickSt1991
2e9f1fd350 version bump 2026-01-18 13:49:57 +01:00
PatrickSt1991
a76b2cc3da Replaced DeviceInfo.Duid with tvIpAddress, SDBClient expects TVIP instead DUID 2026-01-18 13:48:44 +01:00
PatrickSt1991
750f571cf4 code clean up and testin github action 2026-01-18 12:53:22 +01:00
PatrickSt1991
196fe4e89b - GitHub rate limit catched on sdb check
- Developer vs host ip subnet check
- Localization for subnet
2026-01-18 10:03:52 +01:00
kingchenc
9c4c802d6d Fix: Add "IP : Port : Path" server input mode for base path configurations
Users with Jellyfin servers configured with a base path (e.g., http://ip:8096/jellyfin/)
were unable to authenticate. The "IP : Port / Full URL" mode didn't include a base path field, and
while "Full URL" mode worked, it wasn't intuitive for this use case.

The server validation (/System/Info/Public) succeeded, but authentication failed with:
'<' is an invalid start of a value - indicating the API returned HTML instead of JSON
because the base path was missing from the auth endpoint URL.

Fix: Added a third server input mode "IP : Port : Path" that allows users to enter
protocol, IP, port, and base path separately.
2026-01-17 22:11:16 +01:00
kingchenc
0432935f34 Update MainWindow.axaml
Fix dark mode in the main ui in the title
2026-01-17 15:09:54 +01:00
PatrickSt1991
dcbb4a0f4c log folder and hidden element 2026-01-17 14:23:09 +01:00
PatrickSt1991
1f4032602e v2 release 2026-01-17 14:07:44 +01:00
PatrickSt1991
04992e262e dark mode style fix 2026-01-17 08:11:41 +01:00
PatrickSt1991
00b78f4bbe player fix 2026-01-15 21:08:28 +01:00
PatrickSt1991
d19ad9e600 youtube fix 2026-01-15 21:00:32 +01:00
PatrickSt1991
62ea3023ef fix tv debug button
youtube fix
2026-01-15 20:24:28 +01:00
kingchenc
179a6b5785 UI improvements: clickable theme previews, round dark mode toggle, localization fixes
CSS Style Tab
  - Theme preview images are now clickable - opens the theme's GitHub README page
  - Clear button now also resets the theme preview

Settings
  - Fixed dark mode toggle to be round (matching main window style)
2026-01-12 14:48:31 +01:00
kingchenc
fb2a7e59db Small Localization update 2026-01-12 14:31:54 +01:00
kingchenc
2192fede6a Add Dark Mode toggle with dynamic theme switching
Summary

  - Add dark mode toggle icon (☀️/🌙) to main window and settings header for quick theme switching
  - Create ThemeService for centralized theme management with save/load from settings
  - Replace all hardcoded colors with DynamicResource for proper theme support
  - Synchronize theme state between MainWindow and Settings via ThemeChanged event
  - Update Buttons, TextBlocks, and ComboBoxes styles to be theme-aware
  - Fix dark mode for all modal dialogs (BuildInfo, InstallationComplete, Installing, IpInput, TvLogs)
  - Update DialogService to use theme-aware colors from FluentTheme resources
2026-01-12 14:24:49 +01:00
PatrickSt1991
ab61755609 bitmap fix 2026-01-12 13:58:48 +01:00
PatrickSt1991
f5c18ac044 Merge branch 'ps/refactor' of https://github.com/PatrickSt1991/Samsung-Jellyfin-Installer into ps/refactor 2026-01-12 13:51:32 +01:00
PatrickSt1991
22f684275c previewer 2026-01-12 13:51:19 +01:00
kingchenc
0ff3130107 Remove UpdateMode dropdown and User Tab (settings now via JS injection)
Summary
  - Remove UpdateMode dropdown from Server tab - settings are now always applied via JS injection
  - Remove User Tab completely - these settings are default in Jellyfin and API calls are unnecessary
  - Simplify JellyfinPackagePatcher to always apply server settings when JellyfinIP is configured
  - Remove UpdateUserConfigurationsAsync API method and InjectUserSettingsAsync HTML injection
  - Clean up related constants, AppSettings properties, and localization strings (6 languages)

Removed
  - ConfigUpdateModes constants and ConfigUpdateMode setting
  - User settings: AutoPlayNextEpisode, RememberAudioSelections, RememberSubtitleSelections, PlayDefaultAudioTrack, UserAutoLogin
  - 8 localization keys across all language files
2026-01-12 13:33:00 +01:00
PatrickSt1991
4237d3a9db Removed RememberIps
Renamed Force Samsung Login label
Renamen Right-to-left label
2026-01-12 13:06:47 +01:00
kingchenc
16fa6f73e9 Add JellyThemes quick-insert buttons to CSS Style tab
Summary
  - Add JellyThemes section to CSS Style tab with 6 pre-configured themes (Obsidian, Solaris, Nebula, Ember, Void, Phantom)
  - Clicking a theme button inserts the CSS @import statement and auto-validates
  - Add "GitHub JellyThemes" link button to open the theme repository
  - Add localization strings for all 6 languages (en, de, nl, da, fr, tr)

New Files
  - Models/JellyTheme.cs - Theme model with metadata (name, icon, color, CSS URL)

Modified Files
  - ViewModels/JellyfinConfigViewModel.cs - JellyThemes collection and commands
  - Views/JellyfinConfigView.axaml - Theme buttons UI with WrapPanel layout
  - All localization JSON files - Added lblJellyThemes and lblJellyThemesHint
2026-01-12 06:20:54 +01:00
kingchenc
3f3709d4a9 Centralize remaining regex patterns and remove dead code
Summary
  - Removed unused SingleOrArrayConverter.cs (dead Newtonsoft.Json code)
  - Centralized all remaining inline regex patterns into RegexPatterns.cs
  - Eliminated last Newtonsoft.Json dependency from codebase

Changes

New Patterns in RegexPatterns.cs
  | Class | Patterns Added |
  |-------|----------------|
  | Html | BaseTag, LocalPaths, CspMeta |
  | KefinTweaks | Loader, TweaksRoot, ScriptEntry |
  | PluginName | NonAlphanumeric |

Files Updated
  - HtmlUtils.cs → uses RegexPatterns.Html.*
  - ProcessHelper.cs → uses RegexPatterns.CommandLine.Arguments
  - JellyfinPluginPatcher.cs → uses RegexPatterns.Html.LinkHref/ScriptSrc
  - KefinTweaksPatch.cs → uses RegexPatterns.KefinTweaks.*
  - PluginPatches.cs → uses RegexPatterns.PluginName.NonAlphanumeric

Result
  - Zero inline Regex.Match/Replace/Matches calls remaining (except dynamic factory patterns)
  - Zero Newtonsoft.Json usage
  - All static patterns pre-compiled for better performance
2026-01-11 22:51:32 +01:00
kingchenc
c193ccedd2 Refactor: Consolidate helpers, standardize JSON library, and improve code organization
Summary
  - Introduced centralized helper classes to eliminate code duplication and improve maintainability
  - Standardized JSON serialization from Newtonsoft.Json to System.Text.Json
  - Refactored large methods into focused, testable units
  - Added pre-compiled regex patterns for better performance

New Helper Classes

  | File | Purpose |
  |------|---------|
  | Helpers/Core/Constants.cs | Centralized magic strings, error codes, ports, app identifiers |
  | Helpers/Core/UrlHelper.cs | URL normalization (NormalizeServerUrl, CombineUrl, IsValidHttpUrl) |
  | Helpers/Core/PlatformService.cs | Cross-platform OS detection and platform-specific operations |
  | Helpers/Core/RegexPatterns.cs | Pre-compiled regex patterns for version parsing, Tizen capabilities, HTML, etc. |
  | Helpers/Core/JsonSerializerOptionsProvider.cs | Centralized JsonSerializerOptions configurations |

Key Changes

TizenInstallerService Refactoring
  Split 215-line InstallPackageAsync into focused methods:
  - PrepareDeviceAsync() – Device preparation and diagnostics
  - GetDeviceInfoAsync() – Device information collection
  - HandleCertificateAsync() – Certificate handling logic
  - ApplyConfigurationAsync() – Configuration application
  - HandleInstallationResultAsync() – Result processing

JSON Library Migration
  Migrated from Newtonsoft.Json to System.Text.Json:
  - Models/GitHubRelease.cs
  - Helpers/Core/AddLatestRelease.cs
  - Helpers/API/TizenApiClient.cs
  - Services/SamsungLoginService.cs
  - Services/TizenInstallerService.cs
  - ViewModels/MainWindowViewModel.cs

Code Quality Improvements
  - Replaced 13× duplicate TrimEnd('/') calls with UrlHelper
  - Unified OS detection via PlatformService (previously mixed OperatingSystem.* and RuntimeInformation.*)
  - Used Random.Shared instead of new Random() for thread safety
  - Eliminated magic strings/numbers via Constants class
2026-01-11 22:32:13 +01:00
PatrickSt1991
b9979a9aec Removed old elements from localization files 2026-01-10 21:44:44 +01:00
PatrickSt1991
b348416041 plugin refactor 2026-01-10 21:03:22 +01:00
PatrickSt1991
820e6a19a7 Merge branch 'ps/refactor' of https://github.com/PatrickSt1991/Samsung-Jellyfin-Installer into ps/refactor 2026-01-10 20:25:42 +01:00
PatrickSt1991
206659e1d6 . 2026-01-10 20:25:38 +01:00
kingchenc
0cc084aef6 Add Admin Multi-User Support & Refresh Users Button
Summary
  - Added admin detection during authentication - checks User.Policy.IsAdministrator from Jellyfin API
  - Admin users can now select multiple Jellyfin users to configure during installation
  - Non-admin users only configure their own account (single-user mode)
  - Added "Refresh" button to reload user list without logout/login
  - Added hint text explaining that selected users will be configured during installation

Changes
  - JellyfinApiClient: Extended AuthenticateAsync() to return isAdmin, added LoadUsersAsync() method
  - AppSettings: Added IsJellyfinAdmin and SelectedUserIds properties
  - JellyfinConfigViewModel: Added admin state, user collections, refresh command
  - JellyfinConfigView.axaml: Added multi-select ListBox for users (admin only), refresh button, hint text
  - TizenInstallerService: Updated to use selected user IDs when admin, single user ID otherwise
  - Localization: Added lblRefreshUsers and lblUserSelectionHint (6 languages)

Behavior
  - Admin login: Shows user list with multi-select, "Refresh" button, configures all selected users
  - Normal user login: No user selection UI, only own account is configured
  - Auth status shows "Authenticated (Admin)" or "Authenticated"
2026-01-10 16:46:01 +01:00
kingchenc
71fdbf8785 Remove Legacy API Key System & Fix Server Input Mode Persistence
Summary
  - Removed obsolete Legacy API Key system - authentication now uses AccessToken from username/password login exclusively
  - Removed user dropdown (LoadUsersAsync, AvailableJellyfinUsers, SelectedJellyfinUser) - no longer needed since you authenticate AS a specific user
  - Removed "everyone" code path from TizenInstallerService
  - Fixed server input mode not persisting after restart (Full URL mode would reset to IP:Port)
  - Added Logout button to allow switching Jellyfin accounts

Changes
  - JellyfinApiClient: Removed `LoadUsersAsync()`, updated auth to use AccessToken
  - JellyfinConfigViewModel: Removed user collections, selection handlers, and LoadJellyfinUsersAsync
  - JellyfinConfigView.axaml: Simplified Auto-Login section, removed user ComboBox
  - AppSettings: Removed `JellyfinApiKey`, added `ServerInputMode` for persistence
  - TizenInstallerService: Simplified to use single authenticated UserId
  - Localization: Cleaned up obsolete labels (6 languages)
2026-01-10 16:23:10 +01:00
kingchenc
9cd31c48c4 Merge Settings UI into Jellyfin Config with new Main Settings tab
Description:
  Consolidates the separate Settings window into the Jellyfin Config window, now renamed to "Settings".

Changes:
  - Added new "Main" tab containing all application settings (Language, Certificate, Local IP, installation options)
  - Merged SettingsViewModel into JellyfinConfigViewModel
  - Updated navigation to open unified Settings window directly from MainWindow
  - Removed obsolete SettingsView and SettingsViewModel files
  - Added localization support for new tab in all 6 languages (EN, DE, DA, FR, NL, TR)

  The Settings window now has 5 tabs: Main, Server, Playback, User, CSS Style
2026-01-10 15:31:55 +01:00
PatrickSt1991
d515779e17 github releases fetch fix 2026-01-09 22:15:09 +01:00
PatrickSt1991
fbe05e662f github releases helper preventing code duplication 2026-01-09 21:51:59 +01:00
PatrickSt1991
302a53f7b1 refactor 2026-01-09 21:11:14 +01:00
PatrickSt1991
5316c4d609 Refactoring helpers 2026-01-09 18:41:21 +01:00
kingchenc
f3571d6298 Fix installation complete modal closing entire application
Fixed bug where closing the success modal after installation would shut down the entire app instead of just the modal window.

  - Changed CloseWindow() from desktop.Shutdown() to RequestClose event
  - Window now properly subscribes to RequestClose and calls Close()
2026-01-09 01:33:00 +01:00
kingchenc
5f66f952aa Add Custom CSS injection with validation support
Summary:
  - Add new "CSS Style" tab in Jellyfin Config for custom CSS/theme injection
  - Support for inline CSS and @import rules (e.g., ElegantFin, Ultrachromic themes)
  - CSS validation button that tests @import URL reachability and syntax errors
  - Custom CSS is injected as <style> tag into Jellyfin web app during installation

Changes:
  - AppSettings.cs: Add CustomCss property
  - JellyfinConfigViewModel.cs: Add CustomCss observable, validation logic, URL extraction
  - JellyfinConfigView.axaml: New CSS Style tab with multiline TextBox and Validate button
  - JellyfinHtmlPatcher.cs: Add InjectCustomCssAsync() method
  - JellyfinWebPackagePatcher.cs: Call CSS injection during package patching
  - Localization: Add CSS translations for all 6 languages (en, de, fr, nl, tr, da)

Features:
  - Validates @import URLs are reachable before installation
  - Basic CSS syntax validation (balanced braces/parentheses)
  - Button disabled when CSS field is empty
  - Status display with color feedback (green=valid, red=error)
2026-01-09 00:32:12 +01:00
kingchenc
17128965d3 Reorganized the Jellyfin Config Server tab layout for better UX flow and moved legacy features to a dedicated section.
Server Tab now has 3 sections:
  1. Server Settings - Update Mode, Input Mode, Server URL/IP, Connection Status
  2. Auto-Login Settings - User, Password, Authentication
  3. Advanced Settings - TV Debug, Server Scripts, YouTube Fix

User Tab addition:
  - Added "Legacy API Key System" section at bottom
  - Moved API Key field and Jellyfin User(s) dropdown here
  - These are legacy features from WPF era, kept for backward compatibility
2026-01-09 00:32:12 +01:00