diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0931a50..d91d45f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-20.04 # Doesn't really need the Chrome build, but we can reuse its cache. needs: build_chrome - # Only run on master branch AND if tagging or manually dispatching. + # Only run (on master branch && if tagged) or (manually dispatching). if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish_amo_listed == true steps: - name: Checkout diff --git a/package.json b/package.json index c895ee2..7e483c0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "deepmerge": "^4.3.1", "lodash": "^4.17.21", "markdown-it": "^14.0.0", - "neo-scraper": "^0.8.0", + "neo-scraper": "^0.9.0", "normalize.css": "^8.0.1", "pinia": "^2.1.7", "primeflex": "^3.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f474097..a518d68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^14.0.0 version: 14.0.0 neo-scraper: - specifier: ^0.8.0 - version: 0.8.0 + specifier: ^0.9.0 + version: 0.9.0 normalize.css: specifier: ^8.0.1 version: 8.0.1 @@ -2248,8 +2248,8 @@ packages: resolution: {integrity: sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==} hasBin: true - neo-scraper@0.8.0: - resolution: {integrity: sha512-E01oBGuHx9MJOrerkBJpiV0cAHO0uZi28xly4SbELmajf8LQgg1HOH1pq30krBXj5J1px5oRr+3WSO1+1H+sHA==} + neo-scraper@0.9.0: + resolution: {integrity: sha512-KpDrkNSO3pYwYewFWLjrY/OZzLDWh+6Ge021JBExVxA0ZAr67MAKzaNkDXVptW+laz1eZ9Cnl5rvhQZcn+Y0Vw==} nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -5725,7 +5725,7 @@ snapshots: ncp@2.0.0: optional: true - neo-scraper@0.8.0: + neo-scraper@0.9.0: dependencies: js-cookie: 3.0.5 turndown: 7.1.2 diff --git a/src/models/index.ts b/src/models/index.ts index 2c09a06..cb3ecdd 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -8,7 +8,7 @@ export class TagDetails { public names: string[], public category?: string, public usages?: number, - ) {} + ) { } get name() { return this.names[0]; @@ -38,7 +38,7 @@ export class PoolDetails { public names: string[], public category?: string, public postCount?: number, - ) {} + ) { } get name() { return this.names[0]; @@ -73,11 +73,11 @@ export class ScrapedPostDetails { contentType: ContentType; contentSubType: string | undefined; rating: BooruTypes.SafetyRating; - source = ""; + source; + uploadMode: UploadMode; referrer?: string; resolution?: [number, number]; instanceSpecificData: MappedInstanceSpecificData = {}; - uploadMode: UploadMode = "url"; constructor(post: ScrapedPost) { this.contentUrl = post.contentUrl; @@ -91,6 +91,7 @@ export class ScrapedPostDetails { this.tags = post.tags.map((x) => TagDetails.fromScapedTag(x)); this.notes = post.notes; this.resolution = post.resolution; + this.uploadMode = post.uploadMode; } } @@ -108,7 +109,7 @@ export class SimilarPostInfo { constructor( public readonly id: number, public readonly percentage: number, - ) {} + ) { } } export type PostUploadState = "uploading" | "uploaded" | "error"; @@ -147,7 +148,7 @@ export class PostUploadCommandData { constructor( public readonly post: ScrapedPostDetails, public readonly selectedSite: SzuruSiteConfig, - ) {} + ) { } } export class SetPostUploadInfoData { @@ -155,7 +156,7 @@ export class SetPostUploadInfoData { public instanceId: string, public postId: string, public info: PostUploadInfo, - ) {} + ) { } } export class SetExactPostId { @@ -163,7 +164,7 @@ export class SetExactPostId { public readonly instanceId: string, public readonly postId: string, public readonly exactPostId: number, - ) {} + ) { } } export class PostUpdateCommandData { @@ -171,14 +172,14 @@ export class PostUpdateCommandData { public readonly postId: number, public readonly updateRequest: UpdatePostRequest, public readonly selectedSite: SzuruSiteConfig, - ) {} + ) { } } export class FetchCommandData { constructor( public readonly url: string, public readonly options: RequestInit | undefined = undefined, - ) {} + ) { } } export class SzuruSiteConfig { @@ -192,7 +193,7 @@ export class TagCategoryColor { constructor( public name: string, public color: string, - ) {} + ) { } } export const getDefaultTagCategories = () => [ diff --git a/src/options/App.vue b/src/options/App.vue index 36f088a..d093bde 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -11,6 +11,8 @@ import Column from "primevue/column"; import { SzuruSiteConfig, TagCategoryColor, getDefaultTagCategories } from "~/models"; import SzurubooruApi from "~/api"; +type StatusType = "success" | "error" | "quiet"; + const statusText = ref(""); const statusType = ref("status-quiet"); const versionInfo = "Version: " + (import.meta.env.VITE_SZ_VERSION ?? browser.runtime.getManifest().version); @@ -26,9 +28,7 @@ const selectedSite = computed(() => { } }); -type StatusType = "success" | "error" | "quiet"; - -let mode = useColorMode({ emitAuto: true }); +const mode = useColorMode({ emitAuto: true }); async function testConnection() { if ( @@ -221,8 +221,13 @@ wnd.szc_set_config_version = (v = 0) => (cfg.value.version = v);