Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8710dd3a7c | ||
|
|
b1179a6f94 | ||
|
|
e03b6b1fd4 |
@@ -2,10 +2,10 @@
|
||||
# folder exists, and GitHub never reads it.
|
||||
#
|
||||
# Publishes to IPCR on watch.nsl.sh instead of ghcr.io:
|
||||
# push ipcr-push-85-17-246-67.nip.io/metadec.eth/<repo>:<tag> docker login as metadec.eth with the
|
||||
# push ipcr-push-85-17-246-67.ip.nsl.sh/metadec.eth/<repo>:<tag> docker login as metadec.eth with the
|
||||
# IPCR_PUSH_TOKEN secret (the metadec.eth namespace token from the IPCR dashboard)
|
||||
# pull ipcr-watch.nsl.sh/ipns/metadec.eth/metadec.eth/<repo>:<tag> anonymous
|
||||
# The push goes to ipcr-push-85-17-246-67.nip.io, the box's own address, not ipcr-push-watch.nsl.sh: Cloudflare fronts
|
||||
# The push goes to ipcr-push-85-17-246-67.ip.nsl.sh, the box's own address, not ipcr-push-watch.nsl.sh: Cloudflare fronts
|
||||
# *.watch.nsl.sh and refuses any request over 100 MB (413), which a large image layer is.
|
||||
# That host's certificate is signed by the box's private Mesh Router CA, given to buildkit from
|
||||
# the IPCR_CA_PEM repo variable. docker login would make the job's Docker daemon check the
|
||||
@@ -34,7 +34,7 @@ on:
|
||||
default: 'latest'
|
||||
|
||||
env:
|
||||
REGISTRY: ipcr-push-85-17-246-67.nip.io
|
||||
REGISTRY: ipcr-push-85-17-246-67.ip.nsl.sh
|
||||
IPCR_PULL: ipcr-watch.nsl.sh/ipns/metadec.eth
|
||||
IMAGE_NAME: metadec.eth/${{ github.event.repository.name }}
|
||||
|
||||
@@ -79,6 +79,9 @@ jobs:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
# A fix to release 1.2.3 is tagged v1.2.3.1: four numbers are not semver, so
|
||||
# the pattern above makes no tag for it; this one does (image tag 1.2.3.1).
|
||||
type=match,pattern=v(\d+\.\d+\.\d+\.\d+),group=1
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,prefix=
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
@@ -50,6 +50,9 @@ jobs:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
# A fix to release 1.2.3 is tagged v1.2.3.1: four numbers are not semver, so
|
||||
# the pattern above makes no tag for it; this one does (image tag 1.2.3.1).
|
||||
type=match,pattern=v(\d+\.\d+\.\d+\.\d+),group=1
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,prefix=
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
@@ -62,7 +62,8 @@ export function renamingRule(metadata: Partial<MediaMeta>, filepath?: string): s
|
||||
|
||||
// Get title - try various fields
|
||||
// The display name — never the `titles/*` name set (METADATA_KEYS.md §3).
|
||||
const title = metadata.title || metadata.originalTitle;
|
||||
// `parsedTitle` is filename-parser's guess (claims model, D12): last resort.
|
||||
const title = metadata.title || metadata.originalTitle || (metadata as { parsedTitle?: string }).parsedTitle;
|
||||
if (!title) {
|
||||
if (metadata.fileType !== 'torrent') {
|
||||
// Don't warn for torrent files because they don't always have a title
|
||||
|
||||
@@ -436,6 +436,7 @@ export class VirtualFileSystem implements VFSUpdateCallback {
|
||||
* Compute virtual path for a file using template rules
|
||||
*/
|
||||
private computeVirtualPath(metadata: FileMetadata, sourcePath: string): string {
|
||||
metadata = withParsedTitleFallback(metadata);
|
||||
if (!this.rulesConfig) {
|
||||
// Fallback to old behavior
|
||||
return this.metaDataToFolderStruct.generateSingleVirtualPath(sourcePath, metadata);
|
||||
@@ -1105,6 +1106,7 @@ export class VirtualFileSystem implements VFSUpdateCallback {
|
||||
rules: RenamingRule[],
|
||||
defaultRule?: RenamingRule
|
||||
): string {
|
||||
metadata = withParsedTitleFallback(metadata);
|
||||
// Sort rules by priority (descending)
|
||||
const sortedRules = [...rules]
|
||||
.filter(r => r.enabled)
|
||||
@@ -1304,3 +1306,15 @@ export class VirtualFileSystem implements VFSUpdateCallback {
|
||||
this.onFileComplete(hashId, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* filename-parser's guessed title lives under `parsedTitle` since the claims
|
||||
* model (it no longer writes `originalTitle`, which tmdb also writes). The
|
||||
* rules and templates fall back `title` → `originalTitle`; fill a missing
|
||||
* `originalTitle` from `parsedTitle` on a copy so a file with only a parsed
|
||||
* title still gets a path. The record itself is never changed.
|
||||
*/
|
||||
function withParsedTitleFallback<T extends { originalTitle?: unknown; parsedTitle?: unknown }>(metadata: T): T {
|
||||
if (metadata.originalTitle || !metadata.parsedTitle) return metadata;
|
||||
return { ...metadata, originalTitle: metadata.parsedTitle };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user