diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 77300c1..645b359 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -40,6 +40,7 @@ import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {PortalModule} from '@angular/cdk/portal';
import {ScrollingModule} from '@angular/cdk/scrolling';
+import {ClipboardModule} from '@angular/cdk/clipboard';
import { ReactiveFormsModule } from '@angular/forms';
@@ -125,7 +126,8 @@ const MAT_MODULES = [
LayoutModule,
ReactiveFormsModule,
VirtualScrollerModule,
- NgPipesModule
+ NgPipesModule,
+ ClipboardModule
],
providers: [],
bootstrap: [AppComponent]
diff --git a/src/app/file-info-sheet/file-info-sheet.component.html b/src/app/file-info-sheet/file-info-sheet.component.html
index 60cd606..84817a0 100644
--- a/src/app/file-info-sheet/file-info-sheet.component.html
+++ b/src/app/file-info-sheet/file-info-sheet.component.html
@@ -1,54 +1,74 @@
-
File Info
-
-
- {{fileIcon}}
- {{data.file.file_id}}
- {{data.file.mime}} {{data.file.width}}x{{data.file.height}} {{data.file.size | bytes: 2}}
-
-
- {{data.file.is_inbox ? "inbox" : data.file.is_trashed ? "delete" : "archive"}}
- {{data.file.is_inbox ? "In Inbox" : data.file.is_trashed ? "In Trash" : "Archived"}}
-
- open_in_new
-
+
+
+
+
+ {{fileIcon}}
+ {{data.file.file_id}}
+ {{data.file.mime}} {{data.file.width}}x{{data.file.height}} {{data.file.size | bytes: 2}}
-
-
-
-
- 1">
-
Tags
-
-
+
+ {{data.file.is_inbox ? "inbox" : data.file.is_trashed ? "delete" : "archive"}}
+ {{data.file.is_inbox ? "In Inbox" : data.file.is_trashed ? "In Trash" : "Archived"}}
+
+
+ 0">
- {{service.serviceName}} ({{service.statuses[0].length}})
+ Known URLs ({{data.file.known_urls.length}})
-
-
-
- {{tag}}
-
-
-
+
+
+
+ {{ url }}
+
+
+
-
+
+
+
1">
+
Tags
+
+
+
+ {{service.serviceName}} ({{service.statuses[0].length}})
+
+
+
+
+ {{tag}}
+
+
+
+
+
+
diff --git a/src/app/file-info-sheet/file-info-sheet.component.scss b/src/app/file-info-sheet/file-info-sheet.component.scss
index ebb07fe..0d01d36 100644
--- a/src/app/file-info-sheet/file-info-sheet.component.scss
+++ b/src/app/file-info-sheet/file-info-sheet.component.scss
@@ -7,3 +7,11 @@
.mat-list {
padding-top: 0;
}
+
+.sheet-title {
+ margin-top: 0;
+}
+
+.title-row {
+ margin-top: 8px;
+}
diff --git a/src/app/file-info-sheet/file-info-sheet.component.ts b/src/app/file-info-sheet/file-info-sheet.component.ts
index 4b6a51f..4ac8ef5 100644
--- a/src/app/file-info-sheet/file-info-sheet.component.ts
+++ b/src/app/file-info-sheet/file-info-sheet.component.ts
@@ -5,6 +5,7 @@ import { HydrusFilesService } from '../hydrus-files.service';
import { saveAs } from 'file-saver';
import { MatSnackBar } from '@angular/material/snack-bar';
import { tagsObjectFromFile } from '../utils/tag-utils';
+import { SettingsService } from '../settings.service';
interface ShareData {
title?: string;
@@ -32,7 +33,8 @@ export class FileInfoSheetComponent {
constructor(
@Inject(MAT_BOTTOM_SHEET_DATA) public data: {file: HydrusFile},
private filesService: HydrusFilesService,
- private snackbar: MatSnackBar
+ private snackbar: MatSnackBar,
+ public settings: SettingsService,
) { }
tags = Object.entries(tagsObjectFromFile(this.data.file))
@@ -56,6 +58,11 @@ export class FileInfoSheetComponent {
navigatorShare = navigator.share;
navigatorCanShare = navigator.canShare;
+ hyshareUrl =
+ this.settings.appSettings.hyshareUrl && !this.settings.appSettings.hyshareUrl.endsWith('/')
+ ? `${this.settings.appSettings.hyshareUrl}/`
+ : this.settings.appSettings.hyshareUrl;
+
shareUrl(url: string) {
if (navigator.share) {
navigator.share({
diff --git a/src/app/settings.service.ts b/src/app/settings.service.ts
index c885f64..1c3ba34 100644
--- a/src/app/settings.service.ts
+++ b/src/app/settings.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { LocalStorageService } from 'ngx-localstorage';
import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
-import { AppSettings, defaultAppSettings } from './settings';
+import { AppSettings, AppSettingsStorage, defaultAppSettings } from './settings';
@Injectable({
providedIn: 'root'
@@ -17,8 +17,8 @@ export class SettingsService {
public appSettings$: Observable;
constructor(private ls: LocalStorageService) {
- const appSettingsFromStorage = ls.get(this.appSettingsKey) as AppSettings | null;
- this._appSettings = {...defaultAppSettings, ...appSettingsFromStorage};
+ const {version, ...settings} = ls.get(this.appSettingsKey) as AppSettingsStorage | null || {};
+ this._appSettings = {...defaultAppSettings, ...settings};
this._appSettings$ = new BehaviorSubject(this._appSettings);
this.appSettings$ = this._appSettings$.asObservable();
console.log(this.appSettings);
@@ -29,10 +29,14 @@ export class SettingsService {
return this._appSettings;
}
+ private async storeAppSettings(settings: AppSettingsStorage) {
+ return this.ls.asPromisable().set(this.appSettingsKey, settings);
+ }
+
public async setAppSettings(newSettings: Partial) {
this._appSettings = {...defaultAppSettings, ...newSettings};
this._appSettings$.next(this._appSettings);
- return this.ls.asPromisable().set(this.appSettingsKey, this._appSettings);
+ this.storeAppSettings({version : 1, ...this._appSettings})
}
diff --git a/src/app/settings.ts b/src/app/settings.ts
index 915b4ba..d72d97e 100644
--- a/src/app/settings.ts
+++ b/src/app/settings.ts
@@ -6,6 +6,7 @@ export interface AppSettingsV1 {
browseSearchOnLoad: boolean;
browseSearchWhenEmpty: boolean;
browseDefaultSearchTags: HydrusSearchTags;
+ hyshareUrl: string;
}
export type AppSettingsStorage = AppSettingsV1;
@@ -14,5 +15,6 @@ export type AppSettings = Omit;
export const defaultAppSettings: AppSettings = {
browseSearchOnLoad: true,
browseSearchWhenEmpty: true,
- browseDefaultSearchTags: []
+ browseDefaultSearchTags: [],
+ hyshareUrl: ''
}
diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html
index 7925997..3a056a3 100644
--- a/src/app/settings/settings.component.html
+++ b/src/app/settings/settings.component.html
@@ -23,6 +23,11 @@
Search immediately on the browse page
Search with no tags entered
+
+
+ hyshare base URL
+
+