diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 87f209b4..dda2e178 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -8,6 +8,7 @@ on: branches: - master - dev + - testing paths-ignore: - "**.md" - ".github/ISSUE_TEMPLATE/**" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68b10af0..f2c08cfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ on: branches: - dev - master + - testing tags: - "v*" paths-ignore: diff --git a/.gitignore b/.gitignore index 0179ec38..7701ab66 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ build version.txt test_impl.py ./eslint.config.js +.pytest_cache diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 012559a2..6386594d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -223,13 +223,17 @@ cd ui pnpm install ``` +> [!NOTE] +> Create a `.env` file in the `ui/` directory based on `.env.example` to configure environment variables. +> to link the frontend to the backend API. + 3. **Run the frontend development server:** ```bash pnpm dev ``` -The frontend will be available at `http://localhost:3000` (or the port shown in the terminal) +The frontend will be available at `http://localhost:8082` (or the port shown in the terminal) 4. **Verify the setup:** diff --git a/README.md b/README.md index 5a6ac051..e3c19ecc 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,17 @@ For simple API documentation, you can refer to the [API documentation](API.md). # Disclaimer -This project is not affiliated with yt-dlp, or any other service. It's a personal project that was created to -make downloading videos from the internet easier. It's not intended to be used for piracy or any other illegal activities. +This project is not affiliated with yt-dlp or any other service. + +It’s a personal project designed to make downloading videos from the internet more convenient. It’s not intended for +piracy or any unlawful use. + +This project was built primarily for my own needs and preferences. The UI might not be the most polished or visually +refined, but I’m happy with it as it is. You can, however, create and load your own UI for complete customization. I +plan to refactor the UI/UX in the future using [Nuxt/ui](https://ui.nuxt.com/). + +Contributions are welcome, but I may decline changes that don’t align with my vision for the project. Unsolicited pull +requests may be ignored. For suggestions or feature requests, please open a discussion or join the Discord server. # Social contact diff --git a/app/library/Notifications.py b/app/library/Notifications.py index 490ac303..0508da7a 100644 --- a/app/library/Notifications.py +++ b/app/library/Notifications.py @@ -438,7 +438,7 @@ class Notification(metaclass=Singleton): import apprise try: - notify = apprise.Apprise() + notify = apprise.Apprise(debug=self._debug) apr_config = Path(Config.get_instance().apprise_config) if apr_config.exists(): apprise_config = notify.AppriseConfig() @@ -448,11 +448,14 @@ class Notification(metaclass=Singleton): for t in target: notify.add(t.request.url) - notify.notify( + status = await notify.async_notify( body=ev.message or json.dumps(ev.serialize(), sort_keys=False, ensure_ascii=False), title=ev.title or f"YTPTube Event: {ev.event}", - notify_type=ev.event, ) + + if not status: + msg = "Apprise failed to send notification." + raise RuntimeError(msg) # noqa: TRY301 except Exception as e: LOG.exception(e) LOG.error(f"Error sending Apprise notification: {e!s}") diff --git a/app/routes/api/_static.py b/app/routes/api/_static.py index a7feca7b..d1f40ca5 100644 --- a/app/routes/api/_static.py +++ b/app/routes/api/_static.py @@ -30,7 +30,7 @@ FRONTEND_ROUTES: list[str] = [ "/logs/", "/conditions/", "/browser/", - "/settings", + "/settings/", "/browser/{path:.*}", ] diff --git a/app/tests/test_notifications.py b/app/tests/test_notifications.py index 8d59b1a6..998b07bd 100644 --- a/app/tests/test_notifications.py +++ b/app/tests/test_notifications.py @@ -812,6 +812,8 @@ class TestNotification: # Mock apprise import mock_apprise = Mock() mock_notify = Mock() + # Mock async_notify as an AsyncMock that returns True + mock_notify.async_notify = AsyncMock(return_value=True) mock_apprise.Apprise.return_value = mock_notify mock_import.return_value = mock_apprise diff --git a/ui/.env.example b/ui/.env.example new file mode 100644 index 00000000..0aa72bd5 --- /dev/null +++ b/ui/.env.example @@ -0,0 +1,2 @@ +NUXT_API_URL="http://localhost:8081/api/" +NUXT_PUBLIC_WSS=":8081/" diff --git a/ui/app/assets/css/style.css b/ui/app/assets/css/style.css index cd841efe..fb18446a 100644 --- a/ui/app/assets/css/style.css +++ b/ui/app/assets/css/style.css @@ -370,3 +370,4 @@ div.is-centered { padding: 0; margin: 0 auto; } + diff --git a/ui/app/components/FloatingImage.vue b/ui/app/components/FloatingImage.vue index 0b190f3a..6db9b82e 100644 --- a/ui/app/components/FloatingImage.vue +++ b/ui/app/components/FloatingImage.vue @@ -8,7 +8,7 @@