This project provides a utility to reorder how the actors are displayed in the pre-generated.nfo files created by Emby. It features a user-friendly interface that allows users to point to their Emby library and specify a new order for the actors being displayed in that media, supporting both full and partial reordering for TV Shows and Movies.
-
Install Python:
- Visit the official Python website: Download Python.
- Choose the version appropriate for your operating system and download the installer.
- Run the installer. Ensure to check the box that says "Add Python to PATH" at the beginning of the installation process on Windows. This step makes Python and pip accessible from the command line.
-
Verify Python and pip Installation:
- Open your command line interface (CLI), which could be Command Prompt on Windows or Terminal on macOS.
- Type
python --versionand press Enter to ensure Python was installed correctly. If necessary, usepython3 --versionespecially on macOS. - Type
pip --versionand press Enter to confirm that pip, Python’s package installer, is installed correctly. On macOS, you might need to usepip3 --version.
-
Download the Project:
- Clone or download this repository to your local machine. If you are unfamiliar with how to clone a repository, visit GitHub's guide on Cloning a Repository. Or, you can simply click the green "Code" button in the repo and select "Download as Zip" to download it directly; be sure to unzip the files before attempting to use the tool if you download this way.
- Prepare to Run the Application:
- Locate the
ActorReorder.batfile within the downloaded project files. - Double-click the
ActorReorder.batfile to start the application. This batch file will handle the creation of a virtual environment, activate it, install necessary dependencies fromrequirements.txt, and run the script. This file streamlines the process by managing Python virtual environments and dependencies, allowing you to start the application with a simple double-click.
- Locate the
- Prepare to Run the Application:
- Locate the
ActorReorder.shfile within the downloaded project files. - Open Terminal and navigate to the directory containing
ActorReorder.sh. - Before running the script for the first time, you need to make it executable. Type the following command in Terminal:
chmod +x ActorReorder.sh - To run the script, type the following command in Terminal:
./ActorReorder.sh - This script will handle the creation of a virtual environment, activate it, install necessary dependencies from
requirements.txt, and run the script, similar to the batch file on Windows.
- Locate the
Run the ActorReorder.bat file by double-clicking on it. This batch file automates the setup and execution process, ensuring a smooth operation:
- Checks for an Existing Virtual Environment: If not present, it creates one to isolate dependency installations from the global Python environment.
- Activates the Virtual Environment: Ensures all commands and packages are run within this isolated environment.
- Installs Required Packages: Automatically installs all necessary Python packages from
requirements.txtto ensure that all dependencies needed by the script are available within the virtual environment. - Runs the Python Script: Executes the script that:
- Asks for the file directory containing your
.nfofiles. (e.g.,C:\Users\thomw\Desktop\tvshows) - Allows you to reorder the actors listed in each
.nfofile found in the given directory. - Optionally lets you provide full or partial reordering.
- Locks the data after reordering to prevent other processes from overwriting the changes.
- Asks for the file directory containing your
- Deactivates the Virtual Environment: After running the script, it deactivates the environment and returns to the original state.
Run the ActorReorder.sh script by using the Terminal. This shell script automates the setup and execution process similarly to the Windows batch file:
- Navigate to the Script Location: Open Terminal and change to the directory where
ActorReorder.shis located. - Run the Script: Execute the script by typing
./ActorReorder.sh. You may need to ensure the script is executable by runningchmod +x ActorReorder.shif you haven't done so already. - Script Operations:
- Checks for an Existing Virtual Environment: Creates one if it doesn’t exist to ensure all dependencies are managed separately.
- Activates the Virtual Environment: All commands and package installations are performed within this controlled environment.
- Installs Required Packages: Dependencies listed in
requirements.txtare installed to meet the script's requirements. - Runs the Python Script: The script prompts you to:
- Specify the directory containing your
.nfofiles. (e.g.,/Users/thomw/Desktop/tvshows) - Reorder the actors as listed in each
.nfofile found. - Optionally, provide full or partial reordering.
- Ensures data is locked after modifications to avoid overwriting by other processes.
- Specify the directory containing your
- Deactivates the Virtual Environment: The script deactivates the environment upon completion to restore the system to its original configuration.
Microsoft Defender SmartScreen Warning:
- Issue: When running the
ActorReorder.batfile for the first time, Windows Defender SmartScreen may display a warning saying, "Windows protected your PC" and prevent the app from starting, citing an "Unknown publisher." - Resolution: Click on "More info" then scroll to the far right and choose "Run anyway" to proceed with running the script. This warning occurs because the script is unrecognized by Microsoft's security services. Using the "Run anyway" option will allow you to ovveride this security check.
Developed by Thomas Wollin
This project is covered under the MIT license.
- Full and partial reordering of actor entries in
.nfofiles. - Easy to use batch file for running the application on Windows.
- Locks the data after changes to prevent accidental overwriting.
- Supports processing multiple
.nfofiles in a given directory.
Contributions are welcome. Please submit pull requests or issues through the project's GitHub page.
Currently, there are no automated tests for this script. Manual testing is recommended by running the tool on test .nfo files to ensure functionality.
Find me on GitHub: Nillows Email me with any questions: thomwollin@gmail.com