1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-12 04:23:09 +02:00

package update and bugfix

This commit is contained in:
Patrik J. Braun 2018-12-02 20:57:16 +01:00
parent 66d793fe05
commit 5ea5e465b7
8 changed files with 103 additions and 56 deletions

View File

@ -147,7 +147,8 @@ apt-get install build-essential libkrb5-dev gcc g++
* EXIF orientation tag: * EXIF orientation tag:
* There is no nice way to handle EXIF orientation tag properly. * 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)) 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 ## Credits
Crossbrowser testing sponsored by [Browser Stack](https://www.browserstack.com) Crossbrowser testing sponsored by [Browser Stack](https://www.browserstack.com)
[<img src="https://camo.githubusercontent.com/a7b268f2785656ab3ca7b1cbb1633ee5affceb8f/68747470733a2f2f64677a6f7139623561736a67312e636c6f756466726f6e742e6e65742f70726f64756374696f6e2f696d616765732f6c61796f75742f6c6f676f2d6865616465722e706e67" alt="Browser Stack" height="31px" style="background: cornflowerblue;">](https://www.browserstack.com) [<img src="https://camo.githubusercontent.com/a7b268f2785656ab3ca7b1cbb1633ee5affceb8f/68747470733a2f2f64677a6f7139623561736a67312e636c6f756466726f6e742e6e65742f70726f64756374696f6e2f696d616765732f6c61796f75742f6c6f676f2d6865616465722e706e67" alt="Browser Stack" height="31px" style="background: cornflowerblue;">](https://www.browserstack.com)

View File

@ -28,7 +28,15 @@ export class GalleryCacheService {
localStorage.clear(); localStorage.clear();
localStorage.setItem(GalleryCacheService.VERSION, DataStructureVersion.toString()); 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(), timestamp: Date.now(),
item: items item: items
}; };
try {
localStorage.setItem(GalleryCacheService.AUTO_COMPLETE_PREFIX + text, JSON.stringify(tmp)); localStorage.setItem(GalleryCacheService.AUTO_COMPLETE_PREFIX + text, JSON.stringify(tmp));
} catch (e) {
this.reset();
console.error(e);
}
} }
public getInstantSearch(text: string): SearchResultDTO { public getInstantSearch(text: string): SearchResultDTO {
@ -73,7 +86,12 @@ export class GalleryCacheService {
timestamp: Date.now(), timestamp: Date.now(),
item: searchResult item: searchResult
}; };
try {
localStorage.setItem(GalleryCacheService.INSTANT_SEARCH_PREFIX + text, JSON.stringify(tmp)); 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') { if (typeof type !== 'undefined') {
key += GalleryCacheService.SEARCH_TYPE_PREFIX + type; key += GalleryCacheService.SEARCH_TYPE_PREFIX + type;
} }
try {
localStorage.setItem(key, JSON.stringify(tmp)); localStorage.setItem(key, JSON.stringify(tmp));
} catch (e) {
this.reset();
console.error(e);
}
} }
@ -134,8 +157,12 @@ export class GalleryCacheService {
return; return;
} }
try {
localStorage.setItem(key, JSON.stringify(directory)); localStorage.setItem(key, JSON.stringify(directory));
} catch (e) {
this.reset();
console.error(e);
}
directory.directories.forEach((dir: DirectoryDTO) => { directory.directories.forEach((dir: DirectoryDTO) => {
const sub_key = GalleryCacheService.CONTENT_PREFIX + Utils.concatUrls(dir.path, dir.name); const sub_key = GalleryCacheService.CONTENT_PREFIX + Utils.concatUrls(dir.path, dir.name);
if (localStorage.getItem(sub_key) == null) { // don't override existing if (localStorage.getItem(sub_key) == null) { // don't override existing

View File

@ -44,3 +44,10 @@
margin: 0; margin: 0;
font-size: 1.2rem; font-size: 1.2rem;
} }
.dir-link{
cursor: pointer;
}
.dir-link:hover{
text-decoration: underline;
}

View File

@ -10,7 +10,9 @@
<span class="details-icon oi oi-image"></span> <span class="details-icon oi oi-image"></span>
</div> </div>
<div class="col-10"> <div class="col-10">
<div class="details-main"> <div class="details-main dir-link" title="{{FullPath}}"
[routerLink]="['/gallery', DirectoryPath]"
[queryParams]="queryService.getParams()">
{{media.name}} {{media.name}}
</div> </div>
<div class="details-sub row"> <div class="details-sub row">

View File

@ -4,6 +4,7 @@ import {Config} from '../../../../../common/config/public/Config';
import {MediaDTO} from '../../../../../common/entities/MediaDTO'; import {MediaDTO} from '../../../../../common/entities/MediaDTO';
import {VideoDTO, VideoMetadata} from '../../../../../common/entities/VideoDTO'; import {VideoDTO, VideoMetadata} from '../../../../../common/entities/VideoDTO';
import {Utils} from '../../../../../common/Utils'; import {Utils} from '../../../../../common/Utils';
import {QueryService} from '../../../model/query.service';
@Component({ @Component({
selector: 'app-info-panel', selector: 'app-info-panel',
@ -16,7 +17,7 @@ export class InfoPanelLightboxComponent {
public mapEnabled = true; public mapEnabled = true;
constructor(public elementRef: ElementRef) { constructor(public queryService: QueryService) {
this.mapEnabled = Config.Client.Map.enabled; 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); 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) { calcSize(size: number) {
const postFixes = ['B', 'KB', 'MB', 'GB', 'TB']; const postFixes = ['B', 'KB', 'MB', 'GB', 'TB'];

View File

@ -186,14 +186,6 @@
</context-group> </context-group>
<target>Too many results to show. Refine your search.</target> <target>Too many results to show. Refine your search.</target>
</trans-unit> </trans-unit>
<trans-unit id="24f166827601febff9ec90329582bc637781def8" datatype="html">
<source>Searching for:</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/gallery.component.html</context>
<context context-type="linenumber">51</context>
</context-group>
<target>Searching for:</target>
</trans-unit>
<trans-unit id="121cc5391cd2a5115bc2b3160379ee5b36cd7716" datatype="html"> <trans-unit id="121cc5391cd2a5115bc2b3160379ee5b36cd7716" datatype="html">
<source>Settings</source> <source>Settings</source>
<context-group purpose="location"> <context-group purpose="location">
@ -295,11 +287,19 @@
</context-group> </context-group>
<target>Months</target> <target>Months</target>
</trans-unit> </trans-unit>
<trans-unit id="24f166827601febff9ec90329582bc637781def8" datatype="html">
<source>Searching for:</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context>
<context context-type="linenumber">12</context>
</context-group>
<target>Searching for:</target>
</trans-unit>
<trans-unit id="064ce5140698af55532d5c8c6355e4605d2bcc1b" datatype="html"> <trans-unit id="064ce5140698af55532d5c8c6355e4605d2bcc1b" datatype="html">
<source>items</source> <source>items</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context> <context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context>
<context context-type="linenumber">12</context> <context context-type="linenumber">26</context>
</context-group> </context-group>
<target>items</target> <target>items</target>
</trans-unit> </trans-unit>
@ -343,7 +343,7 @@
<source>duration</source> <source>duration</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context> <context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context>
<context context-type="linenumber">48</context> <context context-type="linenumber">50</context>
</context-group> </context-group>
<target>duration</target> <target>duration</target>
</trans-unit> </trans-unit>
@ -351,7 +351,7 @@
<source>bit rate</source> <source>bit rate</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context> <context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context>
<context context-type="linenumber">49</context> <context context-type="linenumber">51</context>
</context-group> </context-group>
<target>bit rate</target> <target>bit rate</target>
</trans-unit> </trans-unit>
@ -1695,13 +1695,13 @@
</context-group> </context-group>
<target>Map</target> <target>Map</target>
</trans-unit> </trans-unit>
<trans-unit id="6bf63e55f9a54c6d0e7a5ee7ed3e3f3ab412fa61" datatype="html"> <trans-unit id="3610ff97c9b9af9a23aa02a1a05d561c8fa03f42" datatype="html">
<source>Meta files</source> <source>Meta file</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">frontend/app/settings/metafiles/metafile.settings.component.ts</context> <context context-type="sourcefile">frontend/app/settings/metafiles/metafile.settings.component.ts</context>
<context context-type="linenumber">1</context> <context context-type="linenumber">1</context>
</context-group> </context-group>
<target>Meta files</target> <target>Meta file</target>
</trans-unit> </trans-unit>
<trans-unit id="c2a9de3714f5767b174d0424bc8abe2dc37acc41" datatype="html"> <trans-unit id="c2a9de3714f5767b174d0424bc8abe2dc37acc41" datatype="html">
<source>Other</source> <source>Other</source>

View File

@ -186,14 +186,6 @@
</context-group> </context-group>
<target>Túl sok eredmény jelenik meg. Pontosítsa a keresést.</target> <target>Túl sok eredmény jelenik meg. Pontosítsa a keresést.</target>
</trans-unit> </trans-unit>
<trans-unit id="24f166827601febff9ec90329582bc637781def8" datatype="html">
<source>Searching for:</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/gallery.component.html</context>
<context context-type="linenumber">51</context>
</context-group>
<target>Keresés:</target>
</trans-unit>
<trans-unit id="121cc5391cd2a5115bc2b3160379ee5b36cd7716" datatype="html"> <trans-unit id="121cc5391cd2a5115bc2b3160379ee5b36cd7716" datatype="html">
<source>Settings</source> <source>Settings</source>
<context-group purpose="location"> <context-group purpose="location">
@ -295,11 +287,19 @@
</context-group> </context-group>
<target>Hónapok</target> <target>Hónapok</target>
</trans-unit> </trans-unit>
<trans-unit id="24f166827601febff9ec90329582bc637781def8" datatype="html">
<source>Searching for:</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context>
<context context-type="linenumber">12</context>
</context-group>
<target>Keresés:</target>
</trans-unit>
<trans-unit id="064ce5140698af55532d5c8c6355e4605d2bcc1b" datatype="html"> <trans-unit id="064ce5140698af55532d5c8c6355e4605d2bcc1b" datatype="html">
<source>items</source> <source>items</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context> <context context-type="sourcefile">app/gallery/navigator/navigator.gallery.component.html</context>
<context context-type="linenumber">12</context> <context context-type="linenumber">26</context>
</context-group> </context-group>
<target>elem</target> <target>elem</target>
</trans-unit> </trans-unit>
@ -343,7 +343,7 @@
<source>duration</source> <source>duration</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context> <context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context>
<context context-type="linenumber">48</context> <context context-type="linenumber">50</context>
</context-group> </context-group>
<target>hossz</target> <target>hossz</target>
</trans-unit> </trans-unit>
@ -351,7 +351,7 @@
<source>bit rate</source> <source>bit rate</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context> <context context-type="sourcefile">app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html</context>
<context context-type="linenumber">49</context> <context context-type="linenumber">51</context>
</context-group> </context-group>
<target>bit ráta</target> <target>bit ráta</target>
</trans-unit> </trans-unit>
@ -1695,13 +1695,13 @@
</context-group> </context-group>
<target>Térkép</target> <target>Térkép</target>
</trans-unit> </trans-unit>
<trans-unit id="6bf63e55f9a54c6d0e7a5ee7ed3e3f3ab412fa61" datatype="html"> <trans-unit id="3610ff97c9b9af9a23aa02a1a05d561c8fa03f42" datatype="html">
<source>Meta files</source> <source>Meta file</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">frontend/app/settings/metafiles/metafile.settings.component.ts</context> <context context-type="sourcefile">frontend/app/settings/metafiles/metafile.settings.component.ts</context>
<context context-type="linenumber">1</context> <context context-type="linenumber">1</context>
</context-group> </context-group>
<target>Metafájlok</target> <target>Meta fájl</target>
</trans-unit> </trans-unit>
<trans-unit id="c2a9de3714f5767b174d0424bc8abe2dc37acc41" datatype="html"> <trans-unit id="c2a9de3714f5767b174d0424bc8abe2dc37acc41" datatype="html">
<source>Other</source> <source>Other</source>

View File

@ -1,6 +1,6 @@
{ {
"name": "pigallery2", "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)", "description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)",
"author": "Patrik J. Braun", "author": "Patrik J. Braun",
"homepage": "https://github.com/bpatrik/PiGallery2", "homepage": "https://github.com/bpatrik/PiGallery2",
@ -35,7 +35,7 @@
"ejs": "2.6.1", "ejs": "2.6.1",
"express": "4.16.4", "express": "4.16.4",
"fluent-ffmpeg": "2.1.2", "fluent-ffmpeg": "2.1.2",
"jimp": "0.5.6", "jimp": "0.6.0",
"locale": "0.1.0", "locale": "0.1.0",
"reflect-metadata": "0.1.12", "reflect-metadata": "0.1.12",
"sqlite3": "4.0.4", "sqlite3": "4.0.4",
@ -47,20 +47,20 @@
}, },
"devDependencies": { "devDependencies": {
"@agm/core": "1.0.0-beta.5", "@agm/core": "1.0.0-beta.5",
"@angular-devkit/build-angular": "0.10.6", "@angular-devkit/build-angular": "0.11.0",
"@angular-devkit/build-optimizer": "0.10.6", "@angular-devkit/build-optimizer": "0.11.0",
"@angular/animations": "7.1.0", "@angular/animations": "7.1.1",
"@angular/cli": "7.0.6", "@angular/cli": "7.1.0",
"@angular/common": "7.1.0", "@angular/common": "7.1.1",
"@angular/compiler": "7.1.0", "@angular/compiler": "7.1.1",
"@angular/compiler-cli": "7.1.0", "@angular/compiler-cli": "7.1.1",
"@angular/core": "7.1.0", "@angular/core": "7.1.1",
"@angular/forms": "7.1.0", "@angular/forms": "7.1.1",
"@angular/http": "7.1.0", "@angular/http": "7.1.1",
"@angular/language-service": "7.1.0", "@angular/language-service": "7.1.1",
"@angular/platform-browser": "7.1.0", "@angular/platform-browser": "7.1.1",
"@angular/platform-browser-dynamic": "7.1.0", "@angular/platform-browser-dynamic": "7.1.1",
"@angular/router": "7.1.0", "@angular/router": "7.1.1",
"@ngx-translate/i18n-polyfill": "1.0.0", "@ngx-translate/i18n-polyfill": "1.0.0",
"@types/bcryptjs": "2.4.2", "@types/bcryptjs": "2.4.2",
"@types/chai": "4.1.7", "@types/chai": "4.1.7",
@ -71,7 +71,7 @@
"@types/fluent-ffmpeg": "2.1.8", "@types/fluent-ffmpeg": "2.1.8",
"@types/gm": "1.18.2", "@types/gm": "1.18.2",
"@types/jasmine": "3.3.0", "@types/jasmine": "3.3.0",
"@types/node": "10.12.10", "@types/node": "10.12.11",
"@types/sharp": "0.21.0", "@types/sharp": "0.21.0",
"@types/winston": "2.3.9", "@types/winston": "2.3.9",
"bootstrap": "4.1.3", "bootstrap": "4.1.3",
@ -88,9 +88,9 @@
"jasmine-core": "3.3.0", "jasmine-core": "3.3.0",
"jasmine-spec-reporter": "4.2.1", "jasmine-spec-reporter": "4.2.1",
"jw-bootstrap-switch-ng2": "2.0.2", "jw-bootstrap-switch-ng2": "2.0.2",
"karma": "3.1.1", "karma": "3.1.3",
"karma-chrome-launcher": "2.2.0", "karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1", "karma-cli": "2.0.0",
"karma-coverage-istanbul-reporter": "2.0.4", "karma-coverage-istanbul-reporter": "2.0.4",
"karma-jasmine": "2.0.1", "karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.0", "karma-jasmine-html-reporter": "1.4.0",