diff --git a/angular.json b/angular.json index da8f68f..507eaa8 100644 --- a/angular.json +++ b/angular.json @@ -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": [ diff --git a/backend/routes/user-collection.routes.js b/backend/routes/user-collection.routes.js index 66ec0da..09bd317 100644 --- a/backend/routes/user-collection.routes.js +++ b/backend/routes/user-collection.routes.js @@ -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(); diff --git a/backend/services/entryService.js b/backend/services/entryService.js index 68a125f..cd61b8c 100644 --- a/backend/services/entryService.js +++ b/backend/services/entryService.js @@ -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); diff --git a/backend/services/mediaService.js b/backend/services/mediaService.js index 34cdab6..6996902 100644 --- a/backend/services/mediaService.js +++ b/backend/services/mediaService.js @@ -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, }; \ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts index d4283ce..d1b88b5 100644 --- a/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-grid-card/userCollection-grid-card.component.ts @@ -111,8 +111,7 @@ export class UserCollectionGridCardComponent implements OnInit { // ? EVENTS cardClick() { - if (this.entry.isInLibrary) - this.router.navigate([`/entries/${this.entry.id}`]); + this.router.navigate([`/entries/${this.entry.id}`]); } // ? EVENT EMITTER diff --git a/frontend/src/app/features/library/library-table-line/library-table-line.component.html b/frontend/src/app/features/library/library-table-line/library-table-line.component.html index 26ef445..8689691 100644 --- a/frontend/src/app/features/library/library-table-line/library-table-line.component.html +++ b/frontend/src/app/features/library/library-table-line/library-table-line.component.html @@ -3,11 +3,11 @@
-
- +
+ logo
- {{entry.title}} + {{entry.title}}

{{entry.seasons.length}} Season{{entry.seasons.length > 1 ? 's' : ''}}

diff --git a/package-lock.json b/package-lock.json index 2660428..06a4cb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 36d4878..42b4fbc 100644 --- a/package.json +++ b/package.json @@ -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",