# CinePlex: Your Plex on Steroids 🚀

## 🤔 What the Heck Is This? Prepare for Takeoff!

Let's be real. You love your Plex server. It's your own little corner of the digital universe, packed with your movies, shows, music, and photos. But... don't you ever feel like the interface could be... *more*? A little more ✨ **magic and sparkle** ✨?

Well, **CinePlex** is the answer to your digital prayers! It's like you bought your Plex a superhero cape and sent it to a futuristic spa. It's a modern, fast, and stunningly designed interface that sits on top of your Plex servers to give you a visually dazzling experience.

**In short:** CinePlex is not a streaming service. It's a *radical transformation* for the content **you already own**. It's your personal media universe, but with steroids and a lot more style!

---

## 🌐 We Speak All Languages! (Well, Almost)

Goodbye, language barrier! 👋 We've been working hard in the lab, and now CinePlex is a polyglot. Thanks to the magic of Chrome's `i18n` API, the extension is fully translated and ready to speak your language. Yes, you heard that right! No more excuses not to dive into your favorite content.

**We currently support:** Spanish, English, German, and French. And we're adding more!

---

## ✨ The Feature Loot Drop (What Makes It Awesome!)

Get ready to be amazed by everything CinePlex has under the hood. This isn't just an extension; it's an experience!

*   **🎬 Pimped-Out Interface:** Forget boring UIs. We use TheMovieDB's API to bring you high-res posters, spectacular backdrops, gripping synopses, ratings, cast info... all the juicy movie gossip you crave!
*   **🗣️ Multilingual Maestro:** Hola! Bonjour! Hallo! CinePlex now speaks your language with full i18n support. No more getting lost in translation – your media, your language!
*   **📡 Psychic Plex & Jellyfin Scanner:** You give it your Plex tokens or Jellyfin server details, and CinePlex goes into full detective mode. It scans your servers, figures out what you *actually* have, and jots it down in its secret notebook (a local IndexedDB database in your browser). It's like having a personal librarian for your media!
*   **✅ "Got It" Badge of Honor:** See a movie you want to watch? CinePlex will let you know if you already have it on your server with a neat "Local" badge. No more blind searching!
*   **🎶 Music Jukebox 2077:** It's not all about movies. We've built a full-fledged music player that connects directly to your Plex music library. Browse artists, listen to albums, and rock out with a **graphic equalizer and audio visualizer**! Your personal party, guaranteed!
*   **📊 The Nerd Stats Panel:** Ever wondered how many 80s movies you have? Or what your most common genre is? Dive into the statistics panel and get a full breakdown of your media library with amazing charts. Unleash your inner nerd!
*   **🖼️ Your Personal Photo Gallery:** Connect to your Plex photo libraries and browse your albums and pictures with a beautiful, integrated lightbox viewer. Relive your memories in style!
*   **📜 The Scroll of Power (M3U):** For the power users. Found that series you wanted to watch? Generate an `.m3u` file with all the episode links with a single click. Power in your hands!
*   **🔥 Stream Straight to Your Server:** This is where it gets wild. Configure a simple PHP script on your server, and you can send streams from CinePlex directly to your M3U playlist file with a single click. We even give you a **PHP script generator** to make it foolproof!
*   **❤️ Favorites & Goldfish Memory:** Save your favorite movies and shows. Plus, we've got a "History" section so you can remember what you were watching last night before you fell asleep on the couch. Never lose track again!
*   **🧠 AI-Powered Recommendations:** Based on your viewing history and favorites, CinePlex will suggest new content you might love. It's like having a personal movie critic living in your browser.
*   **🔭 Server Activity Viewer:** Curious about who's watching what on your Plex server? The Activity Viewer gives you a real-time look at active sessions. It's like having your own mission control!
*   **🔧 Customization Tuning Shop:** Don't like the dark theme? Switch to light mode! Don't want the giant hero banner? Hide it! Add your own TMDB API key. You're the boss, this is your extension!

---

## 🛠️ Installation and First Steps: Liftoff in 3, 2, 1...!

Getting this beast up and running is easier than finding popcorn at the movies. Follow these simple steps and you'll be navigating your media universe like a starship captain.

### 1. Installing the Extension: The First Quantum Leap!

Since we're not yet on the Chrome Web Store (but we will be, oh yes!), you'll have to load it as an "unpacked" extension. Think of it as an exclusive beta launch just for you.

1.  **Download this repository:** Click the green "Code" button and select "Download ZIP". Unzip the file somewhere you'll remember (perhaps your "Documents" folder or a secret place where you keep your digital treasures!).
2.  **Open Chrome Extensions:** In a new tab, type `chrome://extensions` and press Enter. Welcome to the control center of your browser superpowers!
3.  **Enable Developer Mode:** Find the "Developer mode" toggle in the top-right corner and switch it **ON**. It's like turning on your browser's turbo mode!
4.  **Load the Extension:** You'll see some new buttons appear. Click on **"Load unpacked"**.
5.  **Select the Folder:** A file browser will open. Navigate to the folder where you unzipped the repository and select it. Don't pick the wrong folder, or the universe might collapse! (Well, maybe not, but it won't work).
6.  **Mission Ready!** You should now see the CinePlex card in your extensions list. Congratulations, you've installed your first piece of space technology!

### 2. Initial Setup: Your Personal Operations Base!

When you first open CinePlex, it's like a newly built spaceship: impressive, but it needs fuel and coordinates. Let's bring it to life!

1.  **Open CinePlex Settings:** Click the CinePlex icon in your browser's toolbar to open the application in a new tab. Click the **cogwheel icon (⚙️)** in the top-right corner to open the Settings modal. This is where the magic happens!

2.  **Connect to Your Servers:** CinePlex supports both Plex and Jellyfin. You can use either or both!

    *   **For Plex:**
        *   **Find Your Plex Token:** This is the MOST important step. You need your `X-Plex-Token` to let CinePlex talk to your Plex server. The easiest way is to follow the official Plex guide: [Finding an Authentication Token / X-Plex-Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/). Don't share this key with anyone, it's yours and yours alone!
        *   In CinePlex settings, go to the **Plex** tab.
        *   You'll see a code editor. Paste your `X-Plex-Token` inside the square brackets `[]`. If you have more than one, separate them with commas.
        *   Click **"Save Tokens"**.

    *   **For Jellyfin:**
        *   In CinePlex settings, go to the **Jellyfin** tab.
        *   Enter your Jellyfin server's URL, username, and password.
        *   Click **"Connect and Scan"** to test the connection and perform an initial scan.

3.  **Start Your First Scan:**
    *   For Plex, go to the **Plex** tab, check the boxes for the content you want to scan (e.g., Movies, Series, Music, Photos), and click **"Start Scan"**.
    *   For Jellyfin, the initial scan is done when you connect. You can re-scan at any time by clicking the button again.
    *   A console will appear at the bottom of the main page, showing you the scanner's progress. Be patient, the first scan can take a few minutes if you have a gigantic library.

4.  **Enjoy!** Once the scan is complete, the app will automatically refresh. Go back to the main view and start exploring your newly supercharged media interface! The galaxy of your content awaits!

---

## 💡 Pro-Tip: Setting Up the "Add Stream" Feature - The Magic Button!

Want to take your experience to the next level and use the "Add Stream" button? It's like having a magic wand for your content!

1.  In the CinePlex settings, go to the **"PHP Generator"** tab.
2.  Configure the options (like the filename, save path, and security key) and click **"Generate Script"**. Watch as the magic of code materializes!
3.  Copy the generated PHP code. It's your secret recipe!
4.  Save that code as a `.php` file (e.g., `playlist.php`) and upload it to a web server you control. Your own corner on the web for your streams!
5.  Go to the **"General"** tab in settings and paste the public URL to your new script in the **"Stream Server URL"** field. Connecting the dots!
6.  Save, and you're ready! Now you can add streams with a single click. It's like teleporting your content wherever you need it!

---

## 🔒 Permissions: What Does CinePlex Need and Why?

CinePlex is designed to be as non-intrusive as possible, but it does need a few permissions to work its magic:

*   **`storage`**: This allows CinePlex to store your Plex tokens, Jellyfin server details, scanned library data, and your personalized settings directly in your browser's local storage. All your data stays on your machine, safe and sound!
*   **`notifications`**: Used to send you helpful notifications, for example, when a scan is complete or if there's an important update.
*   **`host_permissions` for `http://*/*` and `https://*/*`**: This is crucial! It allows CinePlex to communicate directly with your Plex and Jellyfin servers, which could be on any address on your local network (like `http://192.168.1.100:8096`) or on the web. Without this, CinePlex wouldn't be able to see your awesome media collection.