Files
KefinTweaks/kefinTweaks.js
T

204 lines
10 KiB
JavaScript

// KefinTweaks - Central Configuration and Script Loader
// Copy this entire file into your Jellyfin JS injector plugin
// Modify the configuration below to enable/disable features and customize settings
//
// VERSION: 1.0.0 - Compatible with Jellyfin 10.10.7
//
// FEATURES OVERVIEW:
// =================
// For a detailed feature overview see README.md at https://github.com/ranaldsgift/KefinTweaks
//
// PREREQUISITES:
// ============
// - Jellyfin 10.10.7
// - JS Injector plugin https://github.com/n00bcodr/Jellyfin-JavaScript-Injector
// - Custom Tabs plugin for watchlist functionality https://github.com/IAmParadox27/jellyfin-plugin-custom-tabs
// - JellyfinEnhanced plugin for Jellyseerr search functionality and ExclusiveElsewhere https://github.com/n00bcodr/Jellyfin-Enhanced
//
// INSTALLATION:
// ============
// 0. Install required prerequisites listed above
// 1. Add a new script to your JS Injector plugin
// 2. Copy this entire file into the new script
// (Optional) Enable/disable features, or customize their configuration by editing the script below
// 3. Ensure the script is enabled
// 4. Save your changes
//
// CONFIGURATION GUIDE:
// ===================
// - Scripts: Enable/disable individual features
// - Home Screen: Configure custom sections and discovery settings
// - Exclusive Elsewhere: Only useful if you want to display an icon or logo instead of text
// - Search: Enable Jellyseerr integration adds an option to search for Jellyseerr results only
//
// Considerations for the home screen sections:
// 1. Custom sections (order 1-29) - Your playlist-based sections
// 2. New and Trending sections (order 30-49) - Newest movies and episodes
// 3. Seasonal sections (order 50+) - Holiday-themed content
// 4. Discovery sections (order 200+) - Intelligent recommendations based on your library
(function() {
'use strict';
// ============================================================================
// CENTRAL CONFIGURATION
// ============================================================================
const KEFIN_TWEAKS_CONFIG = {
// ============================================================================
// SCRIPT ROOT CONFIGURATION
// ============================================================================
// Configure where scripts are loaded from
scriptRoot: 'https://cdn.jsdelivr.net/gh/ranaldsgift/KefinTweaks/',
// ============================================================================
// SCRIPT ENABLE/DISABLE FLAGS
// ============================================================================
// Toggle individual features on/off. Dependencies are automatically managed.
scripts: {
// Major feature enhancements
homeScreen: true, // Custom home screen sections and discovery engine
search: true, // Enhanced search with better UI and Jellyseerr integration
// REQUIRES: Watchlist requires Custom Tabs plugin https://github.com/IAmParadox27/jellyfin-plugin-custom-tabs
watchlist: true, // Complete watchlist management with progress tracking
// UI and navigation improvements
headerTabs: true, // Improved header tab functionality and behavior
customMenuLinks: true, // Load and add custom menu links from configuration
breadcrumbs: true, // Breadcrumb navigation for Movies, Series, Seasons, Episodes, Music
// Branding and external integrations
updoot: false, // Integration with Jellyfin Updoot upvote functionality
// REQUIRES: ExclusiveElsewhere requires JellyfinEnhanced plugin https://github.com/n00bcodr/Jellyfin-Enhanced
exclusiveElsewhere: false, // Custom branding when items aren't available on streaming services
// Performance and stability improvements
backdropLeakFix: true, // Fixes memory leaks from backdrop images when tab isn't focused
dashboardButtonFix: true, // Proper back button behavior on dashboard
infiniteScroll: true, // Smooth infinite scrolling for large media libraries
// Playback and media enhancements
removeContinue: true, // Add "Remove from Continue Watching" functionality
subtitleSearch: true, // Search and download subtitles directly from video OSD
playlist: true // Enhanced playlist view with better navigation
},
// ============================================================================
// HOME SCREEN CONFIGURATION
// ============================================================================
// Configure custom home screen sections and discovery features
homeScreen: {
// NEW AND TRENDING SECTIONS
// Automatically curated sections showing latest content
enableNewAndTrending: true, // Master toggle for new and trending sections
enableNewMovies: true, // Show newest movies section
enableNewEpisodes: true, // Show newest episodes from last 7 days
enableTrending: false, // Show trending sections (currently stubs, order 32-33)
// DISCOVERY SECTIONS
// Intelligent recommendations based on your library content
// Includes:
// - [Genre] Movies (random genres with sufficient movie count)
// - Directed by [Director] (top directors from your library)
// - Written by [Writer] (top writers from your library)
// - Starring [Actor] (top actors from your library)
// - Because you watched [Movie] (similar content based on watch history)
// - Because you liked [Movie] (similar content based on favorites)
enableDiscovery: true, // Enables discovery sections on the home screen
// Discovery section behavior and filtering
enableInfiniteScroll: false, // Use infinite scroll vs Load More button
minPeopleAppearances: 10, // Minimum movie appearances for people to be featured
minGenreMovieCount: 50, // Minimum movie count for genres to be included
// WATCHLIST SECTION
// Requires watchlist script to be enabled
enableWatchlist: true, // Show watchlist section on home screen
// SEASONAL SECTIONS
// Holiday-themed content sections
enableSeasonal: true, // Master toggle for seasonal sections
seasonalItemLimit: 16, // Maximum items to show in seasonal sections
// CUSTOM SECTIONS
// Add your own playlist/collection-based sections
customSections: [
// Add more custom sections here
/* Example:
{
// Optionally provide a name, otherwise the name of the playlist/collection will be used
name: 'Your Custom Section',
// The ID of the playlist/collection to display in the section, get this from Jellyfin playlist/collection URL
id: 'acc84f03475eb51602b13cde158d21ad',
// The maximum number of items to display in the section on the home screen
maxItems: 20,
// The order of the section for it to appear on the home screen
order: 5
},
*/
],
},
// ============================================================================
// EXCLUSIVE ELSEWHERE CONFIGURATION
// ============================================================================
// Configure exclusive elsewhere branding behavior
exclusiveElsewhere: {
hideServerName: false // Set to true to hide server name, useful when you want to only show a logo or icon via CSS
},
// ============================================================================
// SEARCH CONFIGURATION
// ============================================================================
// Configure search functionality
search: {
enableJellyseerr: false // Enable Jellyseerr integration for request functionality
},
// ============================================================================
// CUSTOM MENU LINKS CONFIGURATION
// ============================================================================
// Configure custom menu links to be added to the custom menu
customMenuLinks: [
// Add your custom menu links here
/* Example:
{
name: 'My Custom Link', // Display name for the menu item
icon: 'link', // Material icon name (optional, defaults to 'link')
url: '#/userpluginsettings.html?pageUrl=https://domain.com/custom-page', // URL to navigate to
openInNewTab: false // Whether to open in new tab (optional, defaults to false)
},
{
name: 'External Link',
icon: 'open_in_new',
url: 'https://example.com',
openInNewTab: true
},
*/
],
};
// ============================================================================
// CONFIGURATION EXPOSURE
// ============================================================================
// Make configuration available to individual scripts
window.KefinTweaksConfig = KEFIN_TWEAKS_CONFIG;
// ============================================================================
// SCRIPT LOADER INITIALIZATION
// ============================================================================
// Load the injector script which handles loading individual scripts based on configuration
const script = document.createElement("script");
script.src = `${KEFIN_TWEAKS_CONFIG.scriptRoot}injector.js`;
script.async = true;
document.head.appendChild(script);
console.log('[KefinTweaks] Central configuration loaded. Available at window.KefinTweaksConfig');
console.log('[KefinTweaks] Version 1.0.0 - Compatible with Jellyfin 10.10.7');
})();