Compare commits
2 Commits
dev-landin
...
dev-ajax-n
| Author | SHA1 | Date | |
|---|---|---|---|
| 48a601f58d | |||
| a1a38cb74c |
@@ -1,3 +1,4 @@
|
|||||||
|
APP_SECRET="%%app_secret%%"
|
||||||
DATABASE_URL="%%db_url%%"
|
DATABASE_URL="%%db_url%%"
|
||||||
DOWNLOAD_DIR=%%download_dir%%
|
DOWNLOAD_DIR=%%download_dir%%
|
||||||
REAL_DEBRID_KEY="%%rd_key%%"
|
REAL_DEBRID_KEY="%%rd_key%%"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Controller } from '@hotwired/stimulus';
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
import flasher from '@flasher/flasher'
|
||||||
/*
|
/*
|
||||||
* The following line makes this controller "lazy": it won't be downloaded until needed
|
* The following line makes this controller "lazy": it won't be downloaded until needed
|
||||||
* See https://github.com/symfony/stimulus-bridge#lazy-controllers
|
* See https://github.com/symfony/stimulus-bridge#lazy-controllers
|
||||||
@@ -31,7 +31,7 @@ export default class extends Controller {
|
|||||||
})
|
})
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
console.log(json)
|
flasher.success(json.message);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static outlets = ['movie-results', 'tv-results']
|
static outlets = ['movie-results', 'tv-results']
|
||||||
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'selectAll']
|
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'selectAll', 'downloadSelected']
|
||||||
static values = {
|
static values = {
|
||||||
'media-type': String,
|
'media-type': String,
|
||||||
'episodes': Array,
|
'episodes': Array,
|
||||||
@@ -166,11 +166,23 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uncheckSelectAllBtn() {
|
uncheckSelectAllBtn() {
|
||||||
console.log('hurr');
|
|
||||||
this.selectAllTarget.checked = false;
|
this.selectAllTarget.checked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectAllEpisodes() {
|
selectAllEpisodes() {
|
||||||
this.tvResultsOutlets.forEach((episode) => episode.selectEpisodeForDownload());
|
this.tvResultsOutlets.forEach((episode) => {
|
||||||
|
if (episode.isActive()) {
|
||||||
|
episode.selectEpisodeForDownload()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadSelectedEpisodes() {
|
||||||
|
this.tvResultsOutlets.forEach(episode => {
|
||||||
|
if (episode.isActive() && episode.isSelected()) {
|
||||||
|
episode.download();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.selectAllTarget.checked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ export default class extends Controller {
|
|||||||
return this.activeValue;
|
return this.activeValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSelected() {
|
||||||
|
return this.episodeSelectorTarget.checked;
|
||||||
|
}
|
||||||
|
|
||||||
selectEpisodeForDownload() {
|
selectEpisodeForDownload() {
|
||||||
if (true === this.isActive() && this.episodeSelectorTarget.disabled === false) {
|
if (true === this.isActive() && this.episodeSelectorTarget.disabled === false) {
|
||||||
this.episodeSelectorTarget.checked = !this.episodeSelectorTarget.checked;
|
this.episodeSelectorTarget.checked = !this.episodeSelectorTarget.checked;
|
||||||
@@ -71,4 +75,17 @@ export default class extends Controller {
|
|||||||
toggleList() {
|
toggleList() {
|
||||||
this.listTarget.classList.toggle('hidden');
|
this.listTarget.classList.toggle('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
download() {
|
||||||
|
this.options.forEach(option => {
|
||||||
|
const optionSelector = option.querySelector('input[type="checkbox"]');
|
||||||
|
if (true === optionSelector.checked) {
|
||||||
|
const downloadBtn = option.querySelector('button.download-btn');
|
||||||
|
const downloadBtnController = this.application.getControllerForElementAndIdentifier(downloadBtn, 'download-button');
|
||||||
|
downloadBtnController.download();
|
||||||
|
optionSelector.checked = false;
|
||||||
|
this.episodeSelectorTarget.checked = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<copy file="${project.basedir}/.env.dist" tofile="${project.basedir}/.env.local" overwrite="true">
|
<copy file="${project.basedir}/.env.dist" tofile="${project.basedir}/.env.local" overwrite="true">
|
||||||
<filterchain>
|
<filterchain>
|
||||||
<replacetokens begintoken="%%" endtoken="%%">
|
<replacetokens begintoken="%%" endtoken="%%">
|
||||||
|
<token key="app_secret" value="${APP_SECRET}" />
|
||||||
<token key="db_url" value="${DATABASE_URL}" />
|
<token key="db_url" value="${DATABASE_URL}" />
|
||||||
<token key="download_dir" value="${DOWNLOAD_DIR}" />
|
<token key="download_dir" value="${DOWNLOAD_DIR}" />
|
||||||
<token key="rd_key" value="${REAL_DEBRID_KEY}" />
|
<token key="rd_key" value="${REAL_DEBRID_KEY}" />
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"nihilarr/parse-torrent-name": "^0.0.1",
|
"nihilarr/parse-torrent-name": "^0.0.1",
|
||||||
"nyholm/psr7": "*",
|
"nyholm/psr7": "*",
|
||||||
"p3k/emoji-detector": "^1.2",
|
"p3k/emoji-detector": "^1.2",
|
||||||
|
"php-flasher/flasher-symfony": "^2.1",
|
||||||
"php-tmdb/api": "^4.1",
|
"php-tmdb/api": "^4.1",
|
||||||
"symfony/asset": "7.2.*",
|
"symfony/asset": "7.2.*",
|
||||||
"symfony/console": "7.2.*",
|
"symfony/console": "7.2.*",
|
||||||
|
|||||||
137
composer.lock
generated
137
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "09d927397449bd08c7c2b96e35d2bd60",
|
"content-hash": "02f1ff0023fc6fb23a0307520495e75c",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "1tomany/data-uri",
|
"name": "1tomany/data-uri",
|
||||||
@@ -1780,6 +1780,141 @@
|
|||||||
},
|
},
|
||||||
"time": "2024-02-19T18:29:05+00:00"
|
"time": "2024-02-19T18:29:05+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "php-flasher/flasher",
|
||||||
|
"version": "v2.1.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-flasher/flasher.git",
|
||||||
|
"reference": "054a209515d2eb1bb72467023d8614a29b5d2e60"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-flasher/flasher/zipball/054a209515d2eb1bb72467023d8614a29b5d2e60",
|
||||||
|
"reference": "054a209515d2eb1bb72467023d8614a29b5d2e60",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.2"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"functions.php",
|
||||||
|
"helpers.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Flasher\\Prime\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Younes ENNAJI",
|
||||||
|
"email": "younes.ennaji.pro@gmail.com",
|
||||||
|
"homepage": "https://www.linkedin.com/in/younes--ennaji/",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The foundational PHP library for PHPFlasher, enabling the creation of framework-agnostic flash notifications. Ideal for building custom integrations or for use in PHP projects.",
|
||||||
|
"homepage": "https://php-flasher.io",
|
||||||
|
"keywords": [
|
||||||
|
"custom-integrations",
|
||||||
|
"flash-notifications",
|
||||||
|
"flasher-core",
|
||||||
|
"framework-agnostic",
|
||||||
|
"open-source",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/php-flasher/php-flasher/issues",
|
||||||
|
"source": "https://github.com/php-flasher/php-flasher"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.com/paypalme/yoeunes",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/yoeunes",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-02-21T20:05:00+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "php-flasher/flasher-symfony",
|
||||||
|
"version": "v2.1.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-flasher/flasher-symfony.git",
|
||||||
|
"reference": "14bd1ba6bbd1184bde0300a5b02455e886845cea"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-flasher/flasher-symfony/zipball/14bd1ba6bbd1184bde0300a5b02455e886845cea",
|
||||||
|
"reference": "14bd1ba6bbd1184bde0300a5b02455e886845cea",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.2",
|
||||||
|
"php-flasher/flasher": "^2.1.6",
|
||||||
|
"symfony/config": "^7.0",
|
||||||
|
"symfony/console": "^7.0",
|
||||||
|
"symfony/dependency-injection": "^7.0",
|
||||||
|
"symfony/http-kernel": "^7.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/translation": "To translate flash messages, title and presets",
|
||||||
|
"symfony/ux-twig-component": "To utilize and interact with flash messages components in Twig templates"
|
||||||
|
},
|
||||||
|
"type": "symfony-bundle",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Flasher\\Symfony\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Younes ENNAJI",
|
||||||
|
"email": "younes.ennaji.pro@gmail.com",
|
||||||
|
"homepage": "https://www.linkedin.com/in/younes--ennaji/",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Integrate flash notifications into Symfony projects effortlessly with PHPFlasher. Improve user experience and application feedback loops easily.",
|
||||||
|
"homepage": "https://php-flasher.io",
|
||||||
|
"keywords": [
|
||||||
|
"flash-notifications",
|
||||||
|
"open-source",
|
||||||
|
"php",
|
||||||
|
"phpflasher",
|
||||||
|
"symfony",
|
||||||
|
"user-feedback"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/php-flasher/php-flasher/issues",
|
||||||
|
"source": "https://github.com/php-flasher/php-flasher"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.com/paypalme/yoeunes",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/yoeunes",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-02-21T20:05:00+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "php-http/discovery",
|
"name": "php-http/discovery",
|
||||||
"version": "1.20.0",
|
"version": "1.20.0",
|
||||||
|
|||||||
@@ -14,4 +14,5 @@ return [
|
|||||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||||
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
|
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
|
||||||
|
Flasher\Symfony\FlasherSymfonyBundle::class => ['all' => true],
|
||||||
];
|
];
|
||||||
|
|||||||
48
config/packages/flasher.yaml
Normal file
48
config/packages/flasher.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
flasher:
|
||||||
|
# Default notification library (e.g., 'flasher', 'toastr', 'noty', 'notyf', 'sweetalert')
|
||||||
|
default: flasher
|
||||||
|
|
||||||
|
# Path to the main PHPFlasher JavaScript file
|
||||||
|
main_script: '/vendor/flasher/flasher.min.js'
|
||||||
|
|
||||||
|
# List of CSS files to style your notifications
|
||||||
|
styles:
|
||||||
|
- '/vendor/flasher/flasher.min.css'
|
||||||
|
|
||||||
|
# Set global options for all notifications (optional)
|
||||||
|
# options:
|
||||||
|
# # Time in milliseconds before the notification disappears
|
||||||
|
# timeout: 5000
|
||||||
|
# # Where the notification appears on the screen
|
||||||
|
# position: 'top-right'
|
||||||
|
|
||||||
|
# Automatically inject JavaScript and CSS assets into your HTML pages
|
||||||
|
inject_assets: true
|
||||||
|
|
||||||
|
# Enable message translation using Symfony's translation service
|
||||||
|
translate: true
|
||||||
|
|
||||||
|
# URL patterns to exclude from asset injection and flash_bag conversion
|
||||||
|
excluded_paths:
|
||||||
|
- '/^\/_profiler/'
|
||||||
|
- '/^\/_fragment/'
|
||||||
|
|
||||||
|
# Map Symfony flash message keys to notification types
|
||||||
|
flash_bag:
|
||||||
|
success: ['success']
|
||||||
|
error: ['error', 'danger']
|
||||||
|
warning: ['warning', 'alarm']
|
||||||
|
info: ['info', 'notice', 'alert']
|
||||||
|
|
||||||
|
# Set criteria to filter which notifications are displayed (optional)
|
||||||
|
# filter:
|
||||||
|
# # Maximum number of notifications to show at once
|
||||||
|
# limit: 5
|
||||||
|
|
||||||
|
# Define notification presets to simplify notification creation (optional)
|
||||||
|
# presets:
|
||||||
|
# # Example preset:
|
||||||
|
# entity_saved:
|
||||||
|
# type: 'success'
|
||||||
|
# title: 'Entity saved'
|
||||||
|
# message: 'Entity saved successfully'
|
||||||
@@ -25,4 +25,7 @@ return [
|
|||||||
'@symfony/ux-live-component' => [
|
'@symfony/ux-live-component' => [
|
||||||
'path' => './vendor/symfony/ux-live-component/assets/dist/live_controller.js',
|
'path' => './vendor/symfony/ux-live-component/assets/dist/live_controller.js',
|
||||||
],
|
],
|
||||||
|
'@flasher/flasher' => [
|
||||||
|
'version' => '2.1.5',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
2
public/vendor/flasher/flasher.min.css
vendored
Normal file
2
public/vendor/flasher/flasher.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/vendor/flasher/flasher.min.js
vendored
Normal file
1
public/vendor/flasher/flasher.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
public/vendor/flasher/manifest.json
vendored
Normal file
4
public/vendor/flasher/manifest.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"/vendor/flasher/flasher.min.js": "/vendor/flasher/flasher.min.js?id=9a255a6680873c0d5fc3d394a2ba3195",
|
||||||
|
"/vendor/flasher/flasher.min.css": "/vendor/flasher/flasher.min.css?id=7a96e40c68626198d5128ad2fb5d77e0"
|
||||||
|
}
|
||||||
@@ -29,6 +29,9 @@
|
|||||||
"migrations/.gitignore"
|
"migrations/.gitignore"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"php-flasher/flasher-symfony": {
|
||||||
|
"version": "v2.1.6"
|
||||||
|
},
|
||||||
"php-http/discovery": {
|
"php-http/discovery": {
|
||||||
"version": "1.20",
|
"version": "1.20",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
|
|||||||
@@ -71,7 +71,10 @@
|
|||||||
|
|
||||||
{% if results.media.mediaType == "tvshows" %}
|
{% if results.media.mediaType == "tvshows" %}
|
||||||
<div class="flex flex-row gap-2 justify-end px-8">
|
<div class="flex flex-row gap-2 justify-end px-8">
|
||||||
<button class="px-1.5 py-1 bg-green-600 rounded-md text-sm">Download Selected</button>
|
<button class="px-1.5 py-1 bg-green-600 rounded-md text-sm"
|
||||||
|
{{ stimulus_target('result_filter', 'downloadSelected') }}
|
||||||
|
{{ stimulus_action('result_filter', 'downloadSelectedEpisodes', 'click') }}
|
||||||
|
>Download Selected</button>
|
||||||
<input type="checkbox" name="selectAll" id="selectAll"
|
<input type="checkbox" name="selectAll" id="selectAll"
|
||||||
{{ stimulus_target('result_filter', 'selectAll') }}
|
{{ stimulus_target('result_filter', 'selectAll') }}
|
||||||
{{ stimulus_action('result_filter', 'selectAllEpisodes', 'change') }}
|
{{ stimulus_action('result_filter', 'selectAllEpisodes', 'change') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user