-
-
Notifications
You must be signed in to change notification settings - Fork 13
chore(release): bump version to v1.9.0 #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c5fbb29
chore: bump version to v1.8.0
TimilsinaBimal b3850c6
feat: add option to group sort globally
TimilsinaBimal 30e45be
chore: bump version to v1.8.1-rc.1
TimilsinaBimal a5b2ec8
feat: add error message on addon description for failed addon update
TimilsinaBimal 3ed915f
fix: remove . after patch number and include - for rc releases
TimilsinaBimal 94cf964
feat: add option to fetch recommendatins from simkl
TimilsinaBimal 13699bd
feat: add total number of users in ui
TimilsinaBimal bb4724a
fix: simkl trending items not working due to get on list
TimilsinaBimal 43e4336
feat: fetch recommendations from simkl for all loved/liked items
TimilsinaBimal 659f578
feat: generate interest summary and theme catalogs using LLM
TimilsinaBimal 2f9628f
fix: only retry retriable errors
TimilsinaBimal e3865c8
feat: add field to add tmdb api key required
TimilsinaBimal a0d5f8c
refactor: merge validation endpoints into one
TimilsinaBimal d02f17d
refactor: add pydantic model validation for stats endpoint
TimilsinaBimal 2256b3e
Merge branch 'main' of github.com:TimilsinaBimal/Watchly into dev
TimilsinaBimal 3652bbe
fix: remove cache control when there are no recommendations
TimilsinaBimal 3b6f726
fix: improve user settings filtering for simkl candidates
TimilsinaBimal 2354c4d
fix: improve user settings filtering for simkl candidates
TimilsinaBimal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,17 @@ | ||
| from fastapi import APIRouter | ||
| from loguru import logger | ||
|
|
||
| from app.api.models.stats import StatsResponse | ||
| from app.services.token_store import token_store | ||
|
|
||
| router = APIRouter() | ||
| router = APIRouter(tags=["Stats"]) | ||
|
|
||
|
|
||
| @router.get("/stats") | ||
| async def get_stats() -> dict: | ||
| """Return lightweight public stats for the homepage. | ||
|
|
||
| Total users is cached for 12 hours inside TokenStore to avoid heavy scans. | ||
| """ | ||
| async def get_stats() -> StatsResponse: | ||
| try: | ||
| total = await token_store.count_users() | ||
| except Exception as exc: | ||
| logger.warning(f"Failed to get total users: {exc}") | ||
| logger.error(f"Failed to get total users: {exc}") | ||
| total = 0 | ||
| return {"total_users": total} | ||
| return StatsResponse(total_users=total) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| from fastapi import APIRouter, HTTPException | ||
| from google import genai | ||
| from loguru import logger | ||
|
|
||
| from app.api.models.validation import BaseValidationInput, BaseValidationResponse, PosterRatingValidationInput | ||
| from app.services.poster_ratings.factory import PosterProvider, poster_ratings_factory | ||
| from app.services.simkl import simkl_service | ||
| from app.services.tmdb.client import TMDBClient | ||
|
|
||
| router = APIRouter(tags=["Validation"]) | ||
|
|
||
|
|
||
| @router.post("/gemini/validation") | ||
| async def validate_gemini_api_key(data: BaseValidationInput) -> BaseValidationResponse: | ||
| try: | ||
| client = genai.Client(api_key=data.api_key.strip()) | ||
| await client.aio.models.list() | ||
| return BaseValidationResponse(valid=True, message="Gemini API key is valid") | ||
| except Exception as e: | ||
| logger.debug(f"Gemini API key validation failed: {e}") | ||
| return BaseValidationResponse(valid=False, message="Invalid Gemini API key") | ||
|
|
||
|
|
||
| @router.post("/tmdb/validation") | ||
| async def validate_tmdb_api_key(data: BaseValidationInput) -> BaseValidationResponse: | ||
| try: | ||
| client = TMDBClient(api_key=data.api_key.strip(), language="en-US") | ||
| await client.get("/configuration") | ||
| await client.close() | ||
| return BaseValidationResponse(valid=True, message="TMDB API key is valid") | ||
| except Exception as e: | ||
| logger.debug(f"TMDB API key validation failed: {e}") | ||
| return BaseValidationResponse(valid=False, message="Invalid TMDB API key") | ||
|
|
||
|
|
||
| @router.post("/poster-rating/validate") | ||
| async def validate_poster_rating_api_key(payload: PosterRatingValidationInput) -> BaseValidationResponse: | ||
| if not payload.api_key or not payload.api_key.strip(): | ||
| return BaseValidationResponse(valid=False, message="API key cannot be empty") | ||
|
|
||
| try: | ||
| provider_enum = PosterProvider(payload.provider) | ||
| except ValueError: | ||
| raise HTTPException(status_code=400, detail=f"Invalid provider: {payload.provider}") | ||
|
|
||
| try: | ||
| if provider_enum == PosterProvider.RPDB: | ||
| is_valid = await poster_ratings_factory.rpdb_service.validate_api_key(payload.api_key.strip()) | ||
| elif provider_enum == PosterProvider.TOP_POSTERS: | ||
| is_valid = await poster_ratings_factory.top_posters_service.validate_api_key(payload.api_key.strip()) | ||
| else: | ||
| raise HTTPException(status_code=400, detail=f"Unsupported provider: {payload.provider}") | ||
|
|
||
| if is_valid: | ||
| return BaseValidationResponse(valid=True, message="API key is valid") | ||
| return BaseValidationResponse(valid=False, message="Invalid API key") | ||
| except Exception as e: | ||
| logger.error(f"Validation failed: {str(e)}") | ||
| raise HTTPException(status_code=500, detail="Validation failed due to an internal error.") | ||
TimilsinaBimal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| @router.post("/simkl/validation") | ||
| async def validate_simkl_api_key(data: BaseValidationInput) -> BaseValidationResponse: | ||
| try: | ||
| response = await simkl_service.get_trending(data.api_key) | ||
| if response: | ||
| return BaseValidationResponse(valid=True, message="Valid API Key") | ||
| return BaseValidationResponse(valid=False, message="Invalid API Key") | ||
| except Exception as e: | ||
| logger.error(f"Validation failed: {str(e)}") | ||
| raise HTTPException(status_code=500, detail="Validation failed due to an internal error.") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from pydantic import BaseModel | ||
|
|
||
|
|
||
| class StatsResponse(BaseModel): | ||
| total_users: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from pydantic import BaseModel, Field | ||
|
|
||
|
|
||
| class BaseValidationInput(BaseModel): | ||
| api_key: str = Field(description="API key to validate") | ||
|
|
||
|
|
||
| class BaseValidationResponse(BaseModel): | ||
| valid: bool | ||
| message: str | ||
|
|
||
|
|
||
| class PosterRatingValidationInput(BaseValidationInput): | ||
| provider: str = Field(description="Provider name: 'rpdb' or 'top_posters'") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = "1.8.0" | ||
| __version__ = "1.9.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.