minor fixes/changes
This commit is contained in:
1 parent
252f15ffd9
commit
336519be70
8 files changed
+40
-9
No files matched your search
@@ -43,7 +43,6 @@
|
||||
"node_modules/ngx-toastr/toastr.css",
|
||||
"node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
|
||||
"node_modules/flatpickr/dist/flatpickr.min.css",
|
||||
|
||||
"frontend/src/assets/sass/responsive.css"
|
||||
],
|
||||
"scripts": [
|
||||
|
||||
@@ -12,6 +12,8 @@ const { Sequelize } = require('sequelize');
|
||||
const router = express.Router();
|
||||
const multer = require('multer');
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const path = require('path');
|
||||
const { getMediaFolder } = require('../services/mediaService');
|
||||
|
||||
// ! /user-collections
|
||||
// * POST - CREATE UserCollection
|
||||
@@ -82,7 +84,7 @@ router.get('/:id', async (req, res) => {
|
||||
|
||||
const storage = multer.diskStorage({
|
||||
destination: function (req, file, cb) {
|
||||
cb(null, 'uploads/collections/posters/')
|
||||
cb(null, path.join(getMediaFolder(), 'images', 'collections', 'posters'))
|
||||
},
|
||||
filename: function (req, file, cb) {
|
||||
const uniqueFilename = uuidv4();
|
||||
|
||||
@@ -512,9 +512,9 @@ async function refrechEntry(entryId) {
|
||||
|
||||
// ? if the count of a media type == 0, the add the type to mediaToGet
|
||||
let mediaToGet = [];
|
||||
availableMedia.forEach(({ type, count }) => {
|
||||
if (count == 0) mediaToGet.push(type);
|
||||
});
|
||||
for (let key in availableMedia) {
|
||||
if (availableMedia[key] == 0) mediaToGet.push(availableMedia[key]);
|
||||
}
|
||||
|
||||
if (mediaToGet.length != 0) {
|
||||
downloadedImages = await getEntryMedia(data.id, oldEntry.is_tvseries, mediaToGet);
|
||||
|
||||
@@ -97,6 +97,10 @@ function scheduleDownloads(media, mediaType, mediaDir, downloadTasks, downloaded
|
||||
);
|
||||
}
|
||||
|
||||
function getMediaFolder() {
|
||||
return getSettings().userDataPath;
|
||||
}
|
||||
|
||||
function createMediaFolders() {
|
||||
const settings = getSettings();
|
||||
const dataPath = settings.userDataPath;
|
||||
@@ -104,10 +108,12 @@ function createMediaFolders() {
|
||||
const posterDir = path.join(dataPath, 'images', 'entries', 'posters');
|
||||
const backdropDir = path.join(dataPath, 'images', 'entries', 'backdrops');
|
||||
const logoDir = path.join(dataPath, 'images', 'entries', 'logos');
|
||||
const collectionsPostersDir = path.join(dataPath, 'images', 'collections', 'posters');
|
||||
|
||||
fs.mkdirSync(posterDir, { recursive: true });
|
||||
fs.mkdirSync(backdropDir, { recursive: true });
|
||||
fs.mkdirSync(logoDir, { recursive: true });
|
||||
fs.mkdirSync(collectionsPostersDir, { recursive: true });
|
||||
|
||||
// console.log(`Created media folders.`);
|
||||
}
|
||||
@@ -115,4 +121,5 @@ function createMediaFolders() {
|
||||
module.exports = {
|
||||
getEntryMedia,
|
||||
createMediaFolders,
|
||||
getMediaFolder,
|
||||
};
|
||||
-1
@@ -111,7 +111,6 @@ export class UserCollectionGridCardComponent implements OnInit {
|
||||
|
||||
// ? EVENTS
|
||||
cardClick() {
|
||||
if (this.entry.isInLibrary)
|
||||
this.router.navigate([`/entries/${this.entry.id}`]);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -3,11 +3,11 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<div class="product-box">
|
||||
<img [src]="getLogoPath()" width="80" class="rounded-3" alt="">
|
||||
<div class="product-box image-container">
|
||||
<img [src]="getLogoPath()" width="80" alt="logo">
|
||||
</div>
|
||||
<div class="product-info">
|
||||
<a href="javascript:;" class="product-title">{{entry.title}}</a>
|
||||
<a class="product-title link-primary cursor-pointer" (click)="cardClick()">{{entry.title}}</a>
|
||||
<p class="mb-0 product-category" *ngIf="entry.is_tvseries">{{entry.seasons.length}}
|
||||
Season{{entry.seasons.length
|
||||
> 1 ? 's' : ''}}</p>
|
||||
|
||||
Generated
+22
@@ -30,6 +30,8 @@
|
||||
"ngx-bootstrap": "^12.0.0",
|
||||
"ngx-toastr": "^18.0.0",
|
||||
"perfect-scrollbar": "^1.5.5",
|
||||
"primeicons": "^7.0.0",
|
||||
"primeng": "^17.18.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"sequelize": "^6.37.1",
|
||||
"tslib": "^2.3.0",
|
||||
@@ -14474,6 +14476,26 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/primeicons": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/primeicons/-/primeicons-7.0.0.tgz",
|
||||
"integrity": "sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw=="
|
||||
},
|
||||
"node_modules/primeng": {
|
||||
"version": "17.18.0",
|
||||
"resolved": "https://registry.npmjs.org/primeng/-/primeng-17.18.0.tgz",
|
||||
"integrity": "sha512-EcvU/0Ex9QoBR6g6db9fDTCTAmzokW70TV5Oroy2gdvXRr3eqlflnOBoArQsmxTaw1oxSsu68YVj3RvcKYWhTg==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^17.0.0 || ^18.0.0",
|
||||
"@angular/core": "^17.0.0 || ^18.0.0",
|
||||
"@angular/forms": "^17.0.0 || ^18.0.0",
|
||||
"rxjs": "^6.0.0 || ^7.8.1",
|
||||
"zone.js": "~0.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/proc-log": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz",
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
"ngx-bootstrap": "^12.0.0",
|
||||
"ngx-toastr": "^18.0.0",
|
||||
"perfect-scrollbar": "^1.5.5",
|
||||
"primeicons": "^7.0.0",
|
||||
"primeng": "^17.18.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"sequelize": "^6.37.1",
|
||||
"tslib": "^2.3.0",
|
||||
|
||||
Reference in new issue
Block a user