@dominevo/addon-media-library 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/media-library.addon.js +81 -7
- package/dist/media-library.addon.mjs +81 -7
- package/i18n/en.json +3 -1
- package/i18n/it.json +3 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.2] - 2026-12-02
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- The media library declares a Media playback address role, so the operator can choose which hub address the apps stream library media from.
|
|
15
|
+
|
|
10
16
|
## [0.1.1] - 2026-12-02
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -8610,6 +8610,57 @@ var NOT_A_DEVICE = {
|
|
|
8610
8610
|
INTERNAL: "internal plumbing between addons — never operator-facing"
|
|
8611
8611
|
};
|
|
8612
8612
|
//#endregion
|
|
8613
|
+
//#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
|
|
8614
|
+
/**
|
|
8615
|
+
* `address-role-source` — the connection kinds an addon needs of the hub's address
|
|
8616
|
+
* palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
|
|
8617
|
+
* that wants its OWN kind of connection (media playback, a notification link, …)
|
|
8618
|
+
* registers a provider and lists its declarations; the hub's collection fan-out
|
|
8619
|
+
* concatenates the answers, so no central list has to be edited and `local-network`
|
|
8620
|
+
* (which owns the palette and the operator's flags) hardcodes none.
|
|
8621
|
+
*
|
|
8622
|
+
* A declaration stores nothing. The operator's choice lives in `local-network`
|
|
8623
|
+
* (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
|
|
8624
|
+
* (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
|
|
8625
|
+
* resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
|
|
8626
|
+
* is connected to" (the behaviour before the role existed), the others name a fixed role.
|
|
8627
|
+
*/
|
|
8628
|
+
var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
|
|
8629
|
+
/** What an unflagged declared role resolves to. */
|
|
8630
|
+
var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
|
|
8631
|
+
"connection",
|
|
8632
|
+
"appConnections",
|
|
8633
|
+
"publicEndpoint",
|
|
8634
|
+
"internal"
|
|
8635
|
+
]);
|
|
8636
|
+
var addressRoleSourceCapability = {
|
|
8637
|
+
name: "address-role-source",
|
|
8638
|
+
scope: "system",
|
|
8639
|
+
mode: "collection",
|
|
8640
|
+
internal: true,
|
|
8641
|
+
methods: {
|
|
8642
|
+
/** List the address roles this addon declares. */
|
|
8643
|
+
listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
|
|
8644
|
+
/** Stable id: `<addonId>:<kind>`. */
|
|
8645
|
+
id: /* @__PURE__ */ string().min(1),
|
|
8646
|
+
/** The addon that declares and consumes the role. */
|
|
8647
|
+
owner: /* @__PURE__ */ string().min(1),
|
|
8648
|
+
/** i18n key of the label (`addressRole.<owner>.<kind>`). */
|
|
8649
|
+
labelKey: /* @__PURE__ */ string().min(1),
|
|
8650
|
+
/** English fallback when the key has no translation. */
|
|
8651
|
+
label: /* @__PURE__ */ string().min(1),
|
|
8652
|
+
/** i18n key of the description. */
|
|
8653
|
+
descriptionKey: /* @__PURE__ */ string().min(1).optional(),
|
|
8654
|
+
/** English fallback of the description. */
|
|
8655
|
+
description: /* @__PURE__ */ string().min(1).optional(),
|
|
8656
|
+
/** `many`: a set of addresses the client races; `single`: at most one address carries it. */
|
|
8657
|
+
cardinality: AddressRoleCardinalitySchema,
|
|
8658
|
+
/** What the role resolves to while the operator has flagged nothing. */
|
|
8659
|
+
default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
|
|
8660
|
+
})).readonly(), { auth: "admin" }) },
|
|
8661
|
+
vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
|
|
8662
|
+
};
|
|
8663
|
+
//#endregion
|
|
8613
8664
|
//#region ../types/dist/esm/capabilities/app-source.cap.mjs
|
|
8614
8665
|
/**
|
|
8615
8666
|
* `app-source` — collection cap: every addon that offers an app in the viewer
|
|
@@ -8880,6 +8931,21 @@ var mediaLibraryCapability = {
|
|
|
8880
8931
|
vocabulary: { notOperatorFacing: "the media library is a viewer app surface, not a device action" }
|
|
8881
8932
|
};
|
|
8882
8933
|
//#endregion
|
|
8934
|
+
//#region src/address-roles.ts
|
|
8935
|
+
var MEDIA_ADDRESS_ROLE_ID = "media-library:media";
|
|
8936
|
+
function buildAddressRoles() {
|
|
8937
|
+
return [{
|
|
8938
|
+
id: MEDIA_ADDRESS_ROLE_ID,
|
|
8939
|
+
owner: "media-library",
|
|
8940
|
+
labelKey: "media-library:addressRole.media-library.media",
|
|
8941
|
+
label: "Media playback",
|
|
8942
|
+
descriptionKey: "media-library:addressRole.media-library.mediaDescription",
|
|
8943
|
+
description: "The address the apps use to stream library media. Leave it automatic to use whichever address the app is connected to.",
|
|
8944
|
+
cardinality: "many",
|
|
8945
|
+
default: { follow: "connection" }
|
|
8946
|
+
}];
|
|
8947
|
+
}
|
|
8948
|
+
//#endregion
|
|
8883
8949
|
//#region src/app-source.ts
|
|
8884
8950
|
var APP_ID = "media";
|
|
8885
8951
|
function buildApp() {
|
|
@@ -10798,14 +10864,22 @@ var MediaLibraryAddon = class extends BaseAddon {
|
|
|
10798
10864
|
scans.schedule(settings.rescanMinutes);
|
|
10799
10865
|
scans.start("boot");
|
|
10800
10866
|
const apps = { listApps: async () => [buildApp()] };
|
|
10867
|
+
const addressRoles = { listAddressRoles: async () => buildAddressRoles() };
|
|
10801
10868
|
logger.info("media-library initialized");
|
|
10802
|
-
return [
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10869
|
+
return [
|
|
10870
|
+
{
|
|
10871
|
+
capability: mediaLibraryCapability,
|
|
10872
|
+
provider: createMediaLibraryProvider(store, scans)
|
|
10873
|
+
},
|
|
10874
|
+
{
|
|
10875
|
+
capability: appSourceCapability,
|
|
10876
|
+
provider: apps
|
|
10877
|
+
},
|
|
10878
|
+
{
|
|
10879
|
+
capability: addressRoleSourceCapability,
|
|
10880
|
+
provider: addressRoles
|
|
10881
|
+
}
|
|
10882
|
+
];
|
|
10809
10883
|
}
|
|
10810
10884
|
async onShutdown() {
|
|
10811
10885
|
this.scans?.stop();
|
|
@@ -8606,6 +8606,57 @@ var NOT_A_DEVICE = {
|
|
|
8606
8606
|
INTERNAL: "internal plumbing between addons — never operator-facing"
|
|
8607
8607
|
};
|
|
8608
8608
|
//#endregion
|
|
8609
|
+
//#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
|
|
8610
|
+
/**
|
|
8611
|
+
* `address-role-source` — the connection kinds an addon needs of the hub's address
|
|
8612
|
+
* palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
|
|
8613
|
+
* that wants its OWN kind of connection (media playback, a notification link, …)
|
|
8614
|
+
* registers a provider and lists its declarations; the hub's collection fan-out
|
|
8615
|
+
* concatenates the answers, so no central list has to be edited and `local-network`
|
|
8616
|
+
* (which owns the palette and the operator's flags) hardcodes none.
|
|
8617
|
+
*
|
|
8618
|
+
* A declaration stores nothing. The operator's choice lives in `local-network`
|
|
8619
|
+
* (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
|
|
8620
|
+
* (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
|
|
8621
|
+
* resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
|
|
8622
|
+
* is connected to" (the behaviour before the role existed), the others name a fixed role.
|
|
8623
|
+
*/
|
|
8624
|
+
var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
|
|
8625
|
+
/** What an unflagged declared role resolves to. */
|
|
8626
|
+
var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
|
|
8627
|
+
"connection",
|
|
8628
|
+
"appConnections",
|
|
8629
|
+
"publicEndpoint",
|
|
8630
|
+
"internal"
|
|
8631
|
+
]);
|
|
8632
|
+
var addressRoleSourceCapability = {
|
|
8633
|
+
name: "address-role-source",
|
|
8634
|
+
scope: "system",
|
|
8635
|
+
mode: "collection",
|
|
8636
|
+
internal: true,
|
|
8637
|
+
methods: {
|
|
8638
|
+
/** List the address roles this addon declares. */
|
|
8639
|
+
listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
|
|
8640
|
+
/** Stable id: `<addonId>:<kind>`. */
|
|
8641
|
+
id: /* @__PURE__ */ string().min(1),
|
|
8642
|
+
/** The addon that declares and consumes the role. */
|
|
8643
|
+
owner: /* @__PURE__ */ string().min(1),
|
|
8644
|
+
/** i18n key of the label (`addressRole.<owner>.<kind>`). */
|
|
8645
|
+
labelKey: /* @__PURE__ */ string().min(1),
|
|
8646
|
+
/** English fallback when the key has no translation. */
|
|
8647
|
+
label: /* @__PURE__ */ string().min(1),
|
|
8648
|
+
/** i18n key of the description. */
|
|
8649
|
+
descriptionKey: /* @__PURE__ */ string().min(1).optional(),
|
|
8650
|
+
/** English fallback of the description. */
|
|
8651
|
+
description: /* @__PURE__ */ string().min(1).optional(),
|
|
8652
|
+
/** `many`: a set of addresses the client races; `single`: at most one address carries it. */
|
|
8653
|
+
cardinality: AddressRoleCardinalitySchema,
|
|
8654
|
+
/** What the role resolves to while the operator has flagged nothing. */
|
|
8655
|
+
default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
|
|
8656
|
+
})).readonly(), { auth: "admin" }) },
|
|
8657
|
+
vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
|
|
8658
|
+
};
|
|
8659
|
+
//#endregion
|
|
8609
8660
|
//#region ../types/dist/esm/capabilities/app-source.cap.mjs
|
|
8610
8661
|
/**
|
|
8611
8662
|
* `app-source` — collection cap: every addon that offers an app in the viewer
|
|
@@ -8876,6 +8927,21 @@ var mediaLibraryCapability = {
|
|
|
8876
8927
|
vocabulary: { notOperatorFacing: "the media library is a viewer app surface, not a device action" }
|
|
8877
8928
|
};
|
|
8878
8929
|
//#endregion
|
|
8930
|
+
//#region src/address-roles.ts
|
|
8931
|
+
var MEDIA_ADDRESS_ROLE_ID = "media-library:media";
|
|
8932
|
+
function buildAddressRoles() {
|
|
8933
|
+
return [{
|
|
8934
|
+
id: MEDIA_ADDRESS_ROLE_ID,
|
|
8935
|
+
owner: "media-library",
|
|
8936
|
+
labelKey: "media-library:addressRole.media-library.media",
|
|
8937
|
+
label: "Media playback",
|
|
8938
|
+
descriptionKey: "media-library:addressRole.media-library.mediaDescription",
|
|
8939
|
+
description: "The address the apps use to stream library media. Leave it automatic to use whichever address the app is connected to.",
|
|
8940
|
+
cardinality: "many",
|
|
8941
|
+
default: { follow: "connection" }
|
|
8942
|
+
}];
|
|
8943
|
+
}
|
|
8944
|
+
//#endregion
|
|
8879
8945
|
//#region src/app-source.ts
|
|
8880
8946
|
var APP_ID = "media";
|
|
8881
8947
|
function buildApp() {
|
|
@@ -10794,14 +10860,22 @@ var MediaLibraryAddon = class extends BaseAddon {
|
|
|
10794
10860
|
scans.schedule(settings.rescanMinutes);
|
|
10795
10861
|
scans.start("boot");
|
|
10796
10862
|
const apps = { listApps: async () => [buildApp()] };
|
|
10863
|
+
const addressRoles = { listAddressRoles: async () => buildAddressRoles() };
|
|
10797
10864
|
logger.info("media-library initialized");
|
|
10798
|
-
return [
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10865
|
+
return [
|
|
10866
|
+
{
|
|
10867
|
+
capability: mediaLibraryCapability,
|
|
10868
|
+
provider: createMediaLibraryProvider(store, scans)
|
|
10869
|
+
},
|
|
10870
|
+
{
|
|
10871
|
+
capability: appSourceCapability,
|
|
10872
|
+
provider: apps
|
|
10873
|
+
},
|
|
10874
|
+
{
|
|
10875
|
+
capability: addressRoleSourceCapability,
|
|
10876
|
+
provider: addressRoles
|
|
10877
|
+
}
|
|
10878
|
+
];
|
|
10805
10879
|
}
|
|
10806
10880
|
async onShutdown() {
|
|
10807
10881
|
this.scans?.stop();
|
package/i18n/en.json
CHANGED
|
@@ -22,5 +22,7 @@
|
|
|
22
22
|
"mediaLibraryAddon.clusterSettings.s_folders.folderRoots.label": "Folders to walk",
|
|
23
23
|
"mediaLibraryAddon.clusterSettings.s_folders.folderRoots.description": "One absolute path per line. Files the arr apps do not know are added from here.",
|
|
24
24
|
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.label": "Rescan every (minutes)",
|
|
25
|
-
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.description": "0 scans only when asked."
|
|
25
|
+
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.description": "0 scans only when asked.",
|
|
26
|
+
"addressRole.media-library.media": "Media playback",
|
|
27
|
+
"addressRole.media-library.mediaDescription": "The address the apps use to stream library media. Leave it automatic to use whichever address the app is connected to."
|
|
26
28
|
}
|
package/i18n/it.json
CHANGED
|
@@ -22,5 +22,7 @@
|
|
|
22
22
|
"mediaLibraryAddon.clusterSettings.s_folders.folderRoots.label": "Cartelle da scansionare",
|
|
23
23
|
"mediaLibraryAddon.clusterSettings.s_folders.folderRoots.description": "Un percorso assoluto per riga. I file che le app arr non conoscono vengono aggiunti da qui.",
|
|
24
24
|
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.label": "Riscansiona ogni (minuti)",
|
|
25
|
-
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.description": "0 scansiona solo su richiesta."
|
|
25
|
+
"mediaLibraryAddon.clusterSettings.s_folders.rescanMinutes.description": "0 scansiona solo su richiesta.",
|
|
26
|
+
"addressRole.media-library.media": "Riproduzione media",
|
|
27
|
+
"addressRole.media-library.mediaDescription": "L'indirizzo che le app usano per riprodurre i media della libreria. Lascia automatico per usare l'indirizzo a cui l'app è connessa."
|
|
26
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dominevo/addon-media-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The self-hosted media library: a catalogue built from the arr apps and plain folders, probed files, per-user progress, direct play with Range and a native /media app in the viewer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dominevo",
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"name": "app-source"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "address-role-source"
|
|
51
54
|
}
|
|
52
55
|
],
|
|
53
56
|
"icon": "assets/icon.svg",
|
|
@@ -55,7 +58,7 @@
|
|
|
55
58
|
}
|
|
56
59
|
],
|
|
57
60
|
"requires": {
|
|
58
|
-
"server": ">=0.1.
|
|
61
|
+
"server": ">=0.1.47"
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
64
|
"files": [
|