Skip to content

Admin support#126

Merged
MakD merged 4 commits into
masterfrom
admin-support
May 19, 2026
Merged

Admin support#126
MakD merged 4 commits into
masterfrom
admin-support

Conversation

@MakD

@MakD MakD commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

This PR introduces a new admin-focused Server Control Panel for Jellyfin and refactors the server management experience across Jellyfin, Jellyseerr, and Audiobookshelf integrations.

Changes

  • Added real-time server control and monitoring features for administrators:

    • Active sessions
    • Scheduled tasks
    • Restart/shutdown actions
    • Playback/session tracking
  • Refactored server management into modular components with:

    • Sectioned Active/Saved server lists
    • Service-specific tabs
    • Improved connection/service indicators
    • Secondary address management
  • Improved backend and session handling:

    • Added isAdmin support (v43 migration)
    • Expanded Jellyfin admin APIs
    • Enhanced WebSocket refresh/state handling
    • Better service status aggregation
  • Integrated the Control Panel into Settings for admin users.

  • Externalized hardcoded strings for improved localization and accessibility.

  • Updated core dependencies:

    • Gradle 9.4.1
    • AGP 9.2.1
    • Kotlin 2.3.21
    • Media3 1.10.1

MakD added 4 commits May 19, 2026 23:32
…anagement

This commit introduces a comprehensive server control panel for administrators and refactors the server management UI to support detailed statistics and connection handling for Jellyfin, Jellyseerr, and Audiobookshelf.

### Key Changes:

*   **Administration & Control Panel**:
    *   Added `ControlPanelView.kt` and `ControlPanelViewModel.kt` to allow administrators to monitor active sessions, manage scheduled tasks (start/stop), and perform server power actions (restart/shutdown).
    *   Implemented real-time polling for server tasks and active sessions.
    *   Added visual indicators for "Now Playing" items in the control panel with progress tracking.
    *   Integrated WebSocket-aware snackbars to notify users when a server is restarting or has shut down.

*   **Server Management UI Refactoring**:
    *   Decomposed the monolithic server management screen into modular components: `ServerCard.kt`, `ServerDetailDialog.kt`, and service-specific tabs (`JellyfinTab.kt`, `JellyseerrTab.kt`, `AudiobookshelfTab.kt`).
    *   Enhanced `ServerCard` with dynamic "LED" indicators for active services (TMDB, MDBList) and connection types (Local, Tailscale, Remote).
    *   Introduced a segmented tab interface in the server detail dialog for better organization of service-specific stats and network settings.

*   **Data & Domain**:
    *   Updated the `User` model and database schema (v43) to include an `isAdmin` flag.
    *   Expanded `JellyfinRepository` to include administrative APIs for sessions, system power, and scheduled tasks.
    *   Updated `SessionManager` to proactively refresh admin status from the server policy.
    *   Improved `JellyfinWebSocketManager` to trigger home data refreshes upon library changes and handle server state transitions.

*   **UI/UX Improvements**:
    *   Added specialized formatters for listening duration, task execution times, and media ticks.
    *   Introduced new vector assets for admin settings, power controls, and device status.
    *   Implemented "Manage Addresses" views for each service to allow adding/deleting secondary connection URLs.
…gement UI

This commit integrates the server control panel into the main settings flow for administrators and enhances the server management screen by categorizing active and saved connections.

### Key Changes:

*   **Settings & Administration**:
    *   **Control Panel Access**: Added a new entry point for administrators in the `SettingsScreen` header, launching the `ControlPanelView` within a dialog.
    *   **ViewModel Integration**: Updated `SettingsViewModel` and its UI state to track `isAdmin` status, the `serverId`, and the currently `activeServer` object.
    *   **Lifecycle Management**: Implemented a `LaunchedEffect` in the settings screen to initialize the `ControlPanelViewModel` whenever the active server ID changes.

*   **Server Management UI (`ServerManagementScreen.kt`)**:
    *   **Sectioned List**: Refactored the server list to visually separate the "Active Server" from "Saved Servers" using new `ServerSectionHeader` components.
    *   **Conditional Access**: Updated the Jellyfin server details tab to disable the Control Panel button for inactive servers, adding a descriptive label and adjusting visual opacity to reflect availability.

*   **Data & Logic Improvements**:
    *   **Service Status Aggregation**: Enhanced `ServerManagementViewModel` to calculate aggregate `ServiceStatus` (TMDB, Jellyseerr, etc.) for servers that are not currently active, providing better visibility of available features across saved connections.
    *   **Address Filtering**: Refined the secondary address list in the server management view to exclude the primary base URL, preventing redundant display.

*   **UI Components**:
    *   Introduced a new `ServerSectionHeader` for better organizational hierarchy in lazy lists.
    *   Integrated the `ic_admin_panel_settings` icon as a primary action for administrative tasks.
This commit upgrades the project's build infrastructure and several key dependencies to their latest versions, including Gradle, the Android Gradle Plugin, and the Media3 library suite.

### Key Changes:

*   **Build System**:
    *   Updated Gradle wrapper from 9.3.1 to 9.4.1.
    *   Updated Android Gradle Plugin (AGP) from 9.1.0 to 9.2.1.

*   **Core Libraries**:
    *   Updated Kotlin from 2.3.20 to 2.3.21.
    *   Updated Compose BOM from 2026.05.00 to 2026.05.01.
    *   Bumped Media3 (ExoPlayer, Session, and Common) from 1.10.0 to 1.10.1.
    *   Updated `aboutlibrariesCore` to 14.2.0.
…calization

This commit moves hardcoded UI strings, content descriptions, and error messages throughout the server management and control panel screens into `strings.xml`. This improves maintainability and prepares the application for localization.

### Key Changes:

*   **Control Panel (`ControlPanelView.kt`)**:
    *   Externalized strings for server power actions, including titles, confirmation messages, and buttons for Restart and Shutdown dialogs.
    *   Updated active session headers, idle status indicators, and task category labels (e.g., "Running", "Other") to use string resources.
    *   Implemented localized placeholders for unknown devices, titles, and users.

*   **Server Management UI**:
    *   **`ServerCard.kt`**: Moved connection type labels ("Local", "Tailscale", "Remote") and menu options into resources.
    *   **`ServerManagementScreen.kt`**: Refactored section headers for "Active" and "Saved" servers.
    *   **`ServerDetailDialog.kt`**: Updated the `DetailTab` enum to use string resource IDs for tab labels (Jellyfin, Seerr, ABS).

*   **Service-Specific Tabs**:
    *   **Jellyfin**: Externalized administration headers, control panel descriptions, and user count pluralization logic.
    *   **Jellyseerr**: Moved role labels, permission names (Request, Auto-Approve, 4K, Manage), and quota duration strings to resources.
    *   **Audiobookshelf**: Refactored content duration formatting and network connection placeholders to use localized strings.

*   **Resources & Infrastructure**:
    *   Added a comprehensive set of new strings to `strings.xml` covering navigation, actions, status messages, and accessibility descriptions.
    *   Updated `ServerManagementViewModel` to retrieve error messages (e.g., "Address already exists") using `context.getString()`.
    *   Enhanced accessibility by replacing hardcoded `contentDescription` strings with resource lookups across all shared server components.
@MakD MakD merged commit 17f1d30 into master May 19, 2026
1 check failed
@MakD MakD deleted the admin-support branch May 19, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant