MovieMapper/renderer.js
Jarian Cottingham 5b1d24ae4a Add file editing via double-click and fix TVDB ID appending logic
- Add double-click handler to make file names editable in UI
- Remove duplicate IPC handler for rename-file in renderer.js
- Fix checkEpisodeCountMatch to properly validate sequential episodes
- Fix begin-mapping to handle both season folder and show folder cases
- Improve open-file-in-player handler to properly log results
2026-02-26 19:20:15 -06:00

50 lines
1.4 KiB
JavaScript

const UIManager = require('./utils/renderer/UIManager');
// Initialize the application when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
console.log('Movie Mapper application initialized');
// Create and initialize the UI manager
const uiManager = new UIManager();
// Expose to window for debugging and external access
window.uiManager = uiManager;
// Debug function to log problematic file info
window.debugProblematicFile = async (filePath) => {
await uiManager.debugProblematicFile(filePath);
};
// Test TVDB API connectivity
window.testTVDBAPI = async () => {
await uiManager.searchManager.testTVDBAPI();
};
// Open video preview
window.openVideoPreview = async (filePath) => {
await uiManager.modalManager.openVideoPreview(filePath);
};
// Open directory
window.openDirectory = async (directory) => {
await uiManager.openDirectory(directory);
};
// Make file editable
window.makeEditable = (element) => {
uiManager.makeEditable(element);
};
// Handle file name double-click to edit
document.addEventListener('dblclick', (e) => {
const fileNameEl = e.target.closest('.file-name');
if (fileNameEl) {
e.stopPropagation();
uiManager.makeEditable(fileNameEl);
}
});
console.log('UIManager initialized and exposed to window');
});
console.log('Movie Mapper renderer loaded');