From 5ea5e465b758c7b618dc58bbaa0ff948a30e863f Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 2 Dec 2018 20:57:16 +0100 Subject: [PATCH] package update and bugfix --- README.md | 3 +- frontend/app/gallery/cache.gallery.service.ts | 37 +++++++++++++++--- .../info-panel.lightbox.gallery.component.css | 7 ++++ ...info-panel.lightbox.gallery.component.html | 4 +- .../info-panel.lightbox.gallery.component.ts | 12 +++++- frontend/translate/messages.en.xlf | 28 +++++++------- frontend/translate/messages.hu.xlf | 30 +++++++-------- package.json | 38 +++++++++---------- 8 files changed, 103 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 32ef2a8..ab4e925 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,8 @@ apt-get install build-essential libkrb5-dev gcc g++ * EXIF orientation tag: * There is no nice way to handle EXIF orientation tag properly. The page handles these photos, but might cause same error in the user experience (e.g.: the pages loads those photos slower. See issue [#11](https://github.com/bpatrik/pigallery2/issues/11)) - +* Video support on weak servers (like raspberry pi) with low upload rate + * video playback may use up too much resources and the server might not response for a while. A solution might be to down scale / convert the video files to lower bitrate. ## Credits Crossbrowser testing sponsored by [Browser Stack](https://www.browserstack.com) [Browser Stack](https://www.browserstack.com) diff --git a/frontend/app/gallery/cache.gallery.service.ts b/frontend/app/gallery/cache.gallery.service.ts index a5ad661..66b87ac 100644 --- a/frontend/app/gallery/cache.gallery.service.ts +++ b/frontend/app/gallery/cache.gallery.service.ts @@ -28,7 +28,15 @@ export class GalleryCacheService { localStorage.clear(); localStorage.setItem(GalleryCacheService.VERSION, DataStructureVersion.toString()); } + } + private reset() { + try { + localStorage.clear(); + localStorage.setItem(GalleryCacheService.VERSION, DataStructureVersion.toString()); + } catch (e) { + + } } @@ -51,7 +59,12 @@ export class GalleryCacheService { timestamp: Date.now(), item: items }; - localStorage.setItem(GalleryCacheService.AUTO_COMPLETE_PREFIX + text, JSON.stringify(tmp)); + try { + localStorage.setItem(GalleryCacheService.AUTO_COMPLETE_PREFIX + text, JSON.stringify(tmp)); + } catch (e) { + this.reset(); + console.error(e); + } } public getInstantSearch(text: string): SearchResultDTO { @@ -73,7 +86,12 @@ export class GalleryCacheService { timestamp: Date.now(), item: searchResult }; - localStorage.setItem(GalleryCacheService.INSTANT_SEARCH_PREFIX + text, JSON.stringify(tmp)); + try { + localStorage.setItem(GalleryCacheService.INSTANT_SEARCH_PREFIX + text, JSON.stringify(tmp)); + } catch (e) { + this.reset(); + console.error(e); + } } @@ -103,7 +121,12 @@ export class GalleryCacheService { if (typeof type !== 'undefined') { key += GalleryCacheService.SEARCH_TYPE_PREFIX + type; } - localStorage.setItem(key, JSON.stringify(tmp)); + try { + localStorage.setItem(key, JSON.stringify(tmp)); + } catch (e) { + this.reset(); + console.error(e); + } } @@ -134,8 +157,12 @@ export class GalleryCacheService { return; } - localStorage.setItem(key, JSON.stringify(directory)); - + try { + localStorage.setItem(key, JSON.stringify(directory)); + } catch (e) { + this.reset(); + console.error(e); + } directory.directories.forEach((dir: DirectoryDTO) => { const sub_key = GalleryCacheService.CONTENT_PREFIX + Utils.concatUrls(dir.path, dir.name); if (localStorage.getItem(sub_key) == null) { // don't override existing diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css index db6d1ab..7b3e503 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css +++ b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css @@ -44,3 +44,10 @@ margin: 0; font-size: 1.2rem; } + +.dir-link{ + cursor: pointer; +} +.dir-link:hover{ + text-decoration: underline; +} diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html index 8a7ccd9..10258de 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html +++ b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html @@ -10,7 +10,9 @@
-
+
diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts index adcf90f..8047c70 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts +++ b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts @@ -4,6 +4,7 @@ import {Config} from '../../../../../common/config/public/Config'; import {MediaDTO} from '../../../../../common/entities/MediaDTO'; import {VideoDTO, VideoMetadata} from '../../../../../common/entities/VideoDTO'; import {Utils} from '../../../../../common/Utils'; +import {QueryService} from '../../../model/query.service'; @Component({ selector: 'app-info-panel', @@ -16,7 +17,7 @@ export class InfoPanelLightboxComponent { public mapEnabled = true; - constructor(public elementRef: ElementRef) { + constructor(public queryService: QueryService) { this.mapEnabled = Config.Client.Map.enabled; } @@ -28,6 +29,15 @@ export class InfoPanelLightboxComponent { return (this.media.metadata.size.width * this.media.metadata.size.height / 1000000).toFixed(2); } + get FullPath(): string { + return Utils.concatUrls(this.media.directory.path, this.media.directory.name, this.media.name); + } + + get DirectoryPath() { + return Utils.concatUrls(this.media.directory.path, this.media.directory.name); + } + + calcSize(size: number) { const postFixes = ['B', 'KB', 'MB', 'GB', 'TB']; diff --git a/frontend/translate/messages.en.xlf b/frontend/translate/messages.en.xlf index 08ac8ab..d84d774 100644 --- a/frontend/translate/messages.en.xlf +++ b/frontend/translate/messages.en.xlf @@ -186,14 +186,6 @@ Too many results to show. Refine your search. - - Searching for: - - app/gallery/gallery.component.html - 51 - - Searching for: - Settings @@ -295,11 +287,19 @@ Months + + Searching for: + + app/gallery/navigator/navigator.gallery.component.html + 12 + + Searching for: + items app/gallery/navigator/navigator.gallery.component.html - 12 + 26 items @@ -343,7 +343,7 @@ duration app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html - 48 + 50 duration @@ -351,7 +351,7 @@ bit rate app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html - 49 + 51 bit rate @@ -1695,13 +1695,13 @@ Map - - Meta files + + Meta file frontend/app/settings/metafiles/metafile.settings.component.ts 1 - Meta files + Meta file Other diff --git a/frontend/translate/messages.hu.xlf b/frontend/translate/messages.hu.xlf index 3fb8690..810671d 100644 --- a/frontend/translate/messages.hu.xlf +++ b/frontend/translate/messages.hu.xlf @@ -186,14 +186,6 @@ Túl sok eredmény jelenik meg. Pontosítsa a keresést. - - Searching for: - - app/gallery/gallery.component.html - 51 - - Keresés: - Settings @@ -295,11 +287,19 @@ Hónapok + + Searching for: + + app/gallery/navigator/navigator.gallery.component.html + 12 + + Keresés: + items app/gallery/navigator/navigator.gallery.component.html - 12 + 26 elem @@ -343,7 +343,7 @@ duration app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html - 48 + 50 hossz @@ -351,7 +351,7 @@ bit rate app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html - 49 + 51 bit ráta @@ -1695,13 +1695,13 @@ Térkép - - Meta files + + Meta file frontend/app/settings/metafiles/metafile.settings.component.ts 1 - Metafájlok + Meta fájl Other @@ -1769,4 +1769,4 @@ - + \ No newline at end of file diff --git a/package.json b/package.json index e5f1e98..29314c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pigallery2", - "version": "1.2.9", + "version": "1.4.9", "description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)", "author": "Patrik J. Braun", "homepage": "https://github.com/bpatrik/PiGallery2", @@ -35,7 +35,7 @@ "ejs": "2.6.1", "express": "4.16.4", "fluent-ffmpeg": "2.1.2", - "jimp": "0.5.6", + "jimp": "0.6.0", "locale": "0.1.0", "reflect-metadata": "0.1.12", "sqlite3": "4.0.4", @@ -47,20 +47,20 @@ }, "devDependencies": { "@agm/core": "1.0.0-beta.5", - "@angular-devkit/build-angular": "0.10.6", - "@angular-devkit/build-optimizer": "0.10.6", - "@angular/animations": "7.1.0", - "@angular/cli": "7.0.6", - "@angular/common": "7.1.0", - "@angular/compiler": "7.1.0", - "@angular/compiler-cli": "7.1.0", - "@angular/core": "7.1.0", - "@angular/forms": "7.1.0", - "@angular/http": "7.1.0", - "@angular/language-service": "7.1.0", - "@angular/platform-browser": "7.1.0", - "@angular/platform-browser-dynamic": "7.1.0", - "@angular/router": "7.1.0", + "@angular-devkit/build-angular": "0.11.0", + "@angular-devkit/build-optimizer": "0.11.0", + "@angular/animations": "7.1.1", + "@angular/cli": "7.1.0", + "@angular/common": "7.1.1", + "@angular/compiler": "7.1.1", + "@angular/compiler-cli": "7.1.1", + "@angular/core": "7.1.1", + "@angular/forms": "7.1.1", + "@angular/http": "7.1.1", + "@angular/language-service": "7.1.1", + "@angular/platform-browser": "7.1.1", + "@angular/platform-browser-dynamic": "7.1.1", + "@angular/router": "7.1.1", "@ngx-translate/i18n-polyfill": "1.0.0", "@types/bcryptjs": "2.4.2", "@types/chai": "4.1.7", @@ -71,7 +71,7 @@ "@types/fluent-ffmpeg": "2.1.8", "@types/gm": "1.18.2", "@types/jasmine": "3.3.0", - "@types/node": "10.12.10", + "@types/node": "10.12.11", "@types/sharp": "0.21.0", "@types/winston": "2.3.9", "bootstrap": "4.1.3", @@ -88,9 +88,9 @@ "jasmine-core": "3.3.0", "jasmine-spec-reporter": "4.2.1", "jw-bootstrap-switch-ng2": "2.0.2", - "karma": "3.1.1", + "karma": "3.1.3", "karma-chrome-launcher": "2.2.0", - "karma-cli": "1.0.1", + "karma-cli": "2.0.0", "karma-coverage-istanbul-reporter": "2.0.4", "karma-jasmine": "2.0.1", "karma-jasmine-html-reporter": "1.4.0",