454 Commits

Author SHA1 Message Date
mrcanelas 88b94e0041 feat: limit cast parsing to top 5 entries 2025-05-12 18:25:22 -03:00
mrcanelas d0770d345a refactor: remove unused stats endpoint and related analytics code 2025-05-12 18:22:25 -03:00
mrcanelas 551cf841db feat(logo): fetch logos from TMDB and Fanart in parallel and normalize responses
- Reworked getLogo and getTvLogo to use Promise.all for simultaneous requests to Fanart and TMDB
- Normalized logo data from both sources into a common structure
- Improved logo selection logic via unified array passed to pickLogo
- Prioritized Fanart logos by order in combined array
- Closes #101
2025-05-12 18:12:47 -03:00
mrcanelas 70f31cddee feat: add dev:server script for easier development 2025-05-12 18:10:09 -03:00
stekc 4e1be2cf3a feat: cast images 2025-05-12 17:30:03 -03:00
mrcanelas 25fb763ce7 feat(meta): implement caching for IMDb ratings and improve error handling for logo and episode fetching 2025-04-15 20:42:57 -03:00
mrcanelas a9e08741c9 refactor(server): remove unused middleware and router
- refactor(server): remove CORS setup
- refactor(server): remove express-rate-limit and request-ip
- refactor(server): remove unused router instance

This change simplifies the server initialization by removing
unused middleware and redundant router setup. Improves code
readability and reduces unnecessary dependencies.
2025-04-14 17:20:59 -03:00
mrcanelas a944919f20 chore(release): bump version to 3.1.4
- chore(version): update package.json version to 3.1.4
2025-04-13 16:26:54 -03:00
mrcanelas 70d2669e68 feat(security): add authentication to Swagger Stats UI
- feat(security): implement basic auth for /stats/ui endpoint
- feat(security): add METRICS_USER and METRICS_PASSWORD env variables

This change adds a layer of security to the metrics dashboard,
requiring authentication to access the Swagger Stats UI.
2025-04-13 16:26:16 -03:00
mrcanelas e8ee09f681 docs(env): update environment variables configuration
- feat(env): add MONGODB_METRICS for Swagger Stats database
- refactor(env): remove Mixpanel configuration section
- chore(env): update MongoDB URI format with retryWrites parameter
- docs(env): improve variable descriptions and organization

This change reflects the migration from Mixpanel to Swagger Stats
and the addition of a separate MongoDB database for metrics.
2025-04-13 16:10:35 -03:00
mrcanelas b00dafdc18 feat(analytics): replace Mixpanel with Swagger Stats and add rate limiting
- refactor(analytics): remove Mixpanel implementation
- feat(analytics): implement Swagger Stats for metrics and analytics
- feat(security): add rate limiting with express-rate-limit
- feat(security): implement CORS for access control
- feat(security): add request-ip for IP identification
- fix(analytics): fix unique users count via MongoDB

BREAKING CHANGE: Removed Mixpanel dependency. Metrics are now collected via
Swagger Stats and stored in MongoDB. New available routes:
- /stats - general statistics
- /stats/ui - Swagger Stats web interface
- /stats/metrics - detailed metrics
2025-04-13 16:04:21 -03:00
mrcanelas 439a2af19b refactor(getMeta): improve code organization and performance
- Split code into smaller, focused functions
- Implement caching system
- Add parallel async operations
- Improve error handling
- Standardize comments to English
- Optimize response building
- Add helper functions for common operations
2025-04-13 16:00:51 -03:00
mrcanelas 4dbe51ba90 feat(manifest): improve description and show active settings 2025-04-13 16:00:24 -03:00
mrcanelas cdaf5e44c5 refactor: simplify config handling in MultiActionButton
- Remove manual config object construction
- Use complete useConfig object directly
- Simplify code by removing unnecessary destructuring

This change fixes issues with configuration parameters not being
properly passed to the URL and makes the code more maintainable
by reducing boilerplate.
2025-03-07 18:43:32 -03:00
mrcanelas c857d18e2a refactor: improve favicon handling and reorganize static assets
- Move public folder to project root for better organization
- Add proper favicon configuration for all routes using serve-favicon
- Add multiple favicon sizes and formats for better device compatibility
- Add theme-color meta tag for mobile browsers
- Add proper meta description for SEO
- Configure static file serving for both API and configuration page

Changes:
- Moved /configure/public to /public
- Added serve-favicon middleware
- Updated index.html with proper meta tags and favicon links
- Updated static file serving configuration in index.js
- Added proper cache headers for static assets

This change improves the organization of static assets and ensures
the favicon is properly displayed across all routes and devices.
2025-03-07 18:20:47 -03:00
mrcanelas e9185e5126 feat: add option to hide episode thumbnails to prevent spoilers
- Added hideEpisodeThumbnails toggle in configuration page
- Implemented image blur endpoint using Sharp
- Added configuration option in addon URL
- Modified getEpisodes to support blurred thumbnails
- Added blur processing for episode preview images

The feature allows users to enable thumbnail blurring to avoid potential
spoilers from episode preview images. When enabled, all episode thumbnails
are processed through a blur filter before being displayed.

Changes:
- New configuration option in Others.tsx
- New image processing utility in utils/imageProcessor.js
- Modified getEpisodes.js to handle blurred thumbnails
- Added blur endpoint in index.js
- Updated config types and URL generation

Closes #89
2025-03-07 17:26:01 -03:00
mrcanelas 21b19df325 fix: add optional chaining to imdbRating
- Calculation to prevent null pointer exceptions
2025-03-07 14:35:26 -03:00
mrcanelas a30a22af1f fix: remove unnecessary wrapper object from stats endpoint response and simplify error handling 2025-03-07 14:29:42 -03:00
mrcanelas e7d38e9548 feat(analytics): simplify code and prevent unnecessary tracking calls
- Removed unnecessary functions and simplified the code.
- Fixed user tracking functionality.
- Added Mixpanel token verification at the start of the module.
- If the token is not found, the Analytics module exports an empty object with no-op functions.
- Prevented unnecessary tracking calls, avoiding errors in the system when the token is absent.
2025-03-07 10:50:47 -03:00
mrcanelas 31a5c786cf refactor: simplify imdbRating assignment and ensure correct format
- Removed unnecessary ternary operator for cleaner logic
- Ensured `imdbRating` is always formatted with one decimal place using `.toFixed(1)`
- Improved readability and maintainability of the code
2025-03-07 09:09:38 -03:00
Silas Alves f6fe4ef5e4 Merge pull request #88 from TimilsinaBimal/main
fix(rating): handle case when rating cannot fetched from cinemeta
2025-03-07 07:53:26 -03:00
Bimal Timilsina 96d712cb36 fix(rating): handle case when rating cannot fetched from cinemeta
Current implementation don't handle for cases where rating is undefined from cinemeta.
2025-03-05 15:07:18 +05:45
mrcanelas 8bc6239d28 fix: prevent TypeError in parseImdbLink by avoiding toFixed()
Removed `toFixed(1)` on `vote_average` to prevent a TypeError when `vote_average` is not a number.
This ensures the function handles different data types correctly without breaking execution.
2025-03-03 19:10:36 -03:00
mrcanelas 7058a13750 refactor: simplify runtime retrieval logic
Refactored the code to reduce redundancy and improve readability.
- Used Optional Chaining (?.) to avoid explicit array checks.
- Replaced nested ternary operators with Nullish Coalescing (??) for better clarity.
- Preserved the original priority order for retrieving the runtime.
2025-03-03 18:14:39 -03:00
Silas Alves ba0b266df7 Merge pull request #86 from TimilsinaBimal/fix/imdb-rating-links-runtime
Fixes: Incorrect IMDB Rating on Links & Empty Runtime on Series
2025-03-03 18:05:29 -03:00
Bimal Timilsina e7fc4291bb fix: check runtime on episode_run_time array first 2025-03-03 23:38:47 +05:45
Bimal Timilsina b93caf65f2 fix: use runtime from next episode if show is upcoming 2025-03-03 14:30:57 +05:45
Bimal Timilsina 84d1f3259c clean: remove redundant assinment of imdbRating 2025-03-03 14:26:46 +05:45
Bimal Timilsina 019215bde4 fix: fetch runtime from last aired episode 2025-03-02 16:24:28 +05:45
Bimal Timilsina f92426a686 fix: runtime not displayed on some series 2025-03-02 16:10:21 +05:45
Bimal Timilsina e76c968247 fix(server): incorrect imdb rating on links 2025-03-02 16:09:24 +05:45
mrcanelas caf860aa85 feat(analytics): integrate Mixpanel and display unique users in settings
- Add Mixpanel API integration to track addon installations
- Implement /api/stats endpoint to fetch installation statistics
- Display the number of unique users in the settings page
- Improve data handling to prevent parsing errors
2025-02-27 17:50:56 -03:00
mrcanelas 42d40c1b32 docs: comprehensive documentation overhaul
- Rewrite README.md with improved structure and markdown formatting
- Add detailed documentation files:
  - self-hosting.md: Complete guide for deployment (#66)
  - development.md: Development setup and workflow
  - contributing.md: Contribution guidelines
  - api.md: API endpoints and usage

The documentation now includes:
- Clear local development setup instructions
- Detailed deployment guides (Docker and manual)
- Step-by-step environment configuration
- API reference with examples
- Development workflow guidelines
- Troubleshooting sections
- Best practices and code examples

Closes #66
2025-02-24 11:57:29 -03:00
mrcanelas ce742589de fix: catalog genre requirement based on home visibility
Add isRequired flag to genre extra property based on catalog's
showInHome setting. When a catalog is set to show in home, genre
selection becomes optional, otherwise it's required.

This ensures proper catalog behavior depending on its home page
visibility configuration.
2025-02-21 14:49:11 -03:00
mrcanelas 3929bc9407 Merge branch 'main' of https://github.com/mrcanelas/tmdb-addon 2025-02-21 14:43:28 -03:00
Silas Alves 7293550bb8 Merge pull request #76 from TwilightMercy/main
translations.json | Add he-IL (Hebrew) Networks Translation
2025-02-21 14:42:51 -03:00
mrcanelas e1bd6cd2f6 fix: add fallback for untranslated catalog options
When catalog options include a dot notation (field.order), ensure both
translations exist before formatting. Add fallback to original value
when translation is missing.

This fixes the issue where tmdb.trending catalog options were showing
as null instead of their original values.
2025-02-21 14:42:10 -03:00
mrcanelas 2188577c33 fix(#73): catalog enable/disable state and cleanup
- Fix catalog state management to properly handle enabled/disabled state
- Fix issue where disabled catalogs were still being included in addon URL
- Remove unnecessary comments and debug logs
- Clean up code formatting

The main fixes:
1. Ensure disabled catalogs are not included in the addon URL
2. Fix catalog state handling in MultiActionButton
3. Properly sync UI state with actual catalog state

Closes #73
2025-02-21 14:35:52 -03:00
mrcanelas da62e65d19 fix(#79): correct addon installation protocol
- Change install URL to use stremio:// protocol instead of http(s)
- Update MultiActionButton to properly handle Stremio deep linking

This change fixes the addon installation process, ensuring Stremio
opens correctly instead of displaying the manifest.json in browser.

Closes #79
2025-02-21 13:33:58 -03:00
mrcanelas f1febdb0bc feat(#81): add sorting options for watchlist and favorites #81
- Add sorting by date added, popularity, release date and random
- Support sorting in ascending/descending order
- Add translations for sorting options in multiple languages
- Map sorting fields to TMDB API parameters (created_at, popularity, release_date)
- Implement client-side sorting for random order
- Remove redundant code and improve reusability

This change allows users to sort their watchlist and favorites using
different criteria and orders, with proper translation support.

Closes #81
2025-02-21 13:28:54 -03:00
mrcanelas 8c2c47a184 fix(#74, #80): decouple search functionality from popular catalog
- Add searchEnabled state to control search independently
- Add search toggle in Other settings
- Update manifest to handle search catalogs separately

This change allows users to disable the popular catalog while keeping
search functionality, making the addon more flexible and modular.

Closes #74 #80
2025-02-21 13:28:05 -03:00
mrcanelas a82781319f fix(#78): improve search functionality for non-latin queries
- Fix transliteration for non-latin search queries
- Add genre list support to search results
- Remove redundant sorting by popularity
- Fix include_adult parameter handling
- Clean up search result processing

This change improves search accuracy for non-latin characters while
maintaining proper genre information in results.

Closes #78
2025-02-21 13:25:44 -03:00
TwilightMercy e3c541e078 translations.json | Add he-IL (Hebrew) networks translation 2025-02-16 22:09:42 +02:00
mrcanelas 185ea06916 revert: feat: add search toggle functionality 2025-02-14 20:59:55 -03:00
mrcanelas b422028ec3 fix: update image URLs in manifest 2025-02-14 20:35:47 -03:00
mrcanelas c9d6144bb8 bump version to 3.1.3 2025-02-14 20:27:04 -03:00
mrcanelas e72fa883d5 fix: ensure default catalogs are loaded on direct installation
- Add getDefaultCatalogs function using catalog-types.json
- Use default catalogs when no catalogs are configured
- Add minimum vote count filter to improve content quality
- Remove unused getTrending import

This fixes the issue where installing the addon directly without
configuration would result in no catalogs being available.
2025-02-14 19:55:50 -03:00
mrcanelas 07af8d10eb fix: use baseCatalogs for default catalogs initialization
- Remove redundant defaultCatalogIds array
- Use baseCatalogs directly to initialize default catalogs
- Ensure only base catalogs (popular, year, language, trending) are enabled by default

This change simplifies the code by using the existing baseCatalogs
definition instead of maintaining a separate list of default catalog IDs.
2025-02-14 19:10:29 -03:00
mrcanelas 39927a6072 feat: add search toggle functionality
- Add search toggle option in Others settings
- Add searchEnabled state to ConfigContext
- Add search catalogs to manifest when search is enabled
- Make search enabled by default
- Update manifest to include search catalogs for both movies and series

This change allows users to control search functionality independently
from catalog selection.
2025-02-14 19:03:07 -03:00
mrcanelas c529cbca7d feat: add age rating filter system
- Add age rating selection component with visual badges
- Implement US certification filtering for movies and TV shows
- Add certification parameters to TMDB API calls
- Create age rating data structure with G, PG, PG-13, R, NC-17 ratings
- Add info message about trending catalogs limitation
- Handle certification filtering in discover and search endpoints

This feature allows users to filter content based on US age ratings,
helping them find appropriate content for their desired audience.
2025-02-14 18:39:36 -03:00