taglib-wasm 2.2.1 → 2.2.3

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.
Files changed (88) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -3
  3. package/dist/disc-folder.d.ts +3 -1
  4. package/dist/disc-folder.d.ts.map +1 -1
  5. package/dist/disc-folder.js +187 -152
  6. package/dist/index.browser.js +17 -10
  7. package/dist/index.d.ts +1 -1
  8. package/dist/simple.browser.js +13 -8
  9. package/dist/src/constants/properties.d.ts +2 -2
  10. package/dist/src/constants/specialized-properties.d.ts +2 -2
  11. package/dist/src/constants/specialized-properties.js +2 -2
  12. package/dist/src/folder-api/album-corroborate.d.ts +13 -0
  13. package/dist/src/folder-api/album-corroborate.d.ts.map +1 -0
  14. package/dist/src/folder-api/album-corroborate.js +36 -0
  15. package/dist/src/folder-api/album-discs.d.ts +13 -0
  16. package/dist/src/folder-api/album-discs.d.ts.map +1 -0
  17. package/dist/src/folder-api/album-discs.js +122 -0
  18. package/dist/src/folder-api/album-grouping.d.ts +24 -0
  19. package/dist/src/folder-api/album-grouping.d.ts.map +1 -0
  20. package/dist/src/folder-api/album-grouping.js +118 -0
  21. package/dist/src/folder-api/album-identity.d.ts +27 -0
  22. package/dist/src/folder-api/album-identity.d.ts.map +1 -0
  23. package/dist/src/folder-api/album-identity.js +151 -0
  24. package/dist/src/folder-api/{group-albums.d.ts → album-types.d.ts} +55 -26
  25. package/dist/src/folder-api/album-types.d.ts.map +1 -0
  26. package/dist/src/folder-api/album-types.js +0 -0
  27. package/dist/src/folder-api/folder-disc.d.ts +24 -0
  28. package/dist/src/folder-api/folder-disc.d.ts.map +1 -0
  29. package/dist/src/folder-api/folder-disc.js +169 -0
  30. package/dist/src/folder-api/index.d.ts +3 -1
  31. package/dist/src/folder-api/index.d.ts.map +1 -1
  32. package/dist/src/folder-api/index.js +2 -4
  33. package/dist/src/folder-api/scan-for-albums.d.ts +1 -1
  34. package/dist/src/folder-api/scan-for-albums.d.ts.map +1 -1
  35. package/dist/src/folder-api/scan-for-albums.js +1 -3
  36. package/dist/src/runtime/detector.d.ts +16 -1
  37. package/dist/src/runtime/detector.d.ts.map +1 -1
  38. package/dist/src/runtime/detector.js +58 -52
  39. package/dist/src/runtime/platform-io.d.ts +8 -0
  40. package/dist/src/runtime/platform-io.d.ts.map +1 -1
  41. package/dist/src/runtime/platform-io.js +11 -11
  42. package/dist/src/runtime/unified-loader/module-selection.d.ts +2 -2
  43. package/dist/src/runtime/unified-loader/module-selection.d.ts.map +1 -1
  44. package/dist/src/runtime/unified-loader/module-selection.js +3 -5
  45. package/dist/src/runtime/wasi-adapter/audio-properties.d.ts +20 -0
  46. package/dist/src/runtime/wasi-adapter/audio-properties.d.ts.map +1 -0
  47. package/dist/src/runtime/wasi-adapter/audio-properties.js +85 -0
  48. package/dist/src/runtime/wasi-adapter/file-handle.d.ts +5 -19
  49. package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
  50. package/dist/src/runtime/wasi-adapter/file-handle.js +67 -389
  51. package/dist/src/runtime/wasi-adapter/handle-state.d.ts +28 -0
  52. package/dist/src/runtime/wasi-adapter/handle-state.d.ts.map +1 -0
  53. package/dist/src/runtime/wasi-adapter/handle-state.js +58 -0
  54. package/dist/src/runtime/wasi-adapter/mp4-items.d.ts +34 -0
  55. package/dist/src/runtime/wasi-adapter/mp4-items.d.ts.map +1 -0
  56. package/dist/src/runtime/wasi-adapter/mp4-items.js +80 -0
  57. package/dist/src/runtime/wasi-adapter/property-surface.d.ts +25 -0
  58. package/dist/src/runtime/wasi-adapter/property-surface.d.ts.map +1 -0
  59. package/dist/src/runtime/wasi-adapter/property-surface.js +104 -0
  60. package/dist/src/runtime/wasi-adapter/structured-fields.d.ts +44 -0
  61. package/dist/src/runtime/wasi-adapter/structured-fields.d.ts.map +1 -0
  62. package/dist/src/runtime/wasi-adapter/structured-fields.js +139 -0
  63. package/dist/src/runtime/wasi-adapter/tag-keys.d.ts +28 -0
  64. package/dist/src/runtime/wasi-adapter/tag-keys.d.ts.map +1 -0
  65. package/dist/src/runtime/wasi-adapter/tag-keys.js +46 -0
  66. package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
  67. package/dist/src/taglib/audio-file-impl.js +2 -2
  68. package/dist/src/taglib/embind-adapter.d.ts.map +1 -1
  69. package/dist/src/taglib/embind-adapter.js +4 -1
  70. package/dist/src/taglib/id3v2-frames.d.ts.map +1 -1
  71. package/dist/src/taglib/id3v2-frames.js +2 -2
  72. package/dist/src/types/audio-formats.d.ts +5 -5
  73. package/dist/src/types/audio-formats.d.ts.map +1 -1
  74. package/dist/src/types/format-property-keys.d.ts +1 -1
  75. package/dist/src/types/format-property-keys.d.ts.map +1 -1
  76. package/dist/src/types/tags.d.ts +8 -1
  77. package/dist/src/types/tags.d.ts.map +1 -1
  78. package/dist/src/utils/tag-mapping.d.ts.map +1 -1
  79. package/dist/src/utils/tag-mapping.js +2 -0
  80. package/dist/src/version.d.ts +1 -1
  81. package/dist/src/version.js +1 -1
  82. package/dist/src/web-utils/data-url.d.ts.map +1 -1
  83. package/dist/src/web-utils/data-url.js +4 -2
  84. package/dist/taglib-wasi.wasm +0 -0
  85. package/dist/taglib-web.wasm +0 -0
  86. package/package.json +8 -13
  87. package/dist/src/folder-api/group-albums.d.ts.map +0 -1
  88. package/dist/src/folder-api/group-albums.js +0 -544
@@ -61,7 +61,7 @@ export declare const SPECIALIZED_PROPERTIES: {
61
61
  };
62
62
  readonly releaseType: {
63
63
  readonly key: "RELEASETYPE";
64
- readonly description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE";
64
+ readonly description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.2 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE";
65
65
  readonly type: "string";
66
66
  readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF", "Matroska"];
67
67
  readonly mappings: {
@@ -75,7 +75,7 @@ export declare const SPECIALIZED_PROPERTIES: {
75
75
  };
76
76
  readonly releaseCountry: {
77
77
  readonly key: "RELEASECOUNTRY";
78
- readonly description: "Release country (ISO 3166-1 code, e.g. 'US'). TagLib 2.3.1 translates the RELEASECOUNTRY key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM RELEASE COUNTRY' (TagLib's description casing; an uppercase TXXX:RELEASECOUNTRY description also reads back), MP4 freeform atom 'MusicBrainz Album Release Country', APEv2 raw RELEASECOUNTRY, ASF 'MusicBrainz/Album Release Country', WAV ICNT, Vorbis/Matroska raw RELEASECOUNTRY";
78
+ readonly description: "Release country (ISO 3166-1 code, e.g. 'US'). TagLib 2.3.2 translates the RELEASECOUNTRY key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM RELEASE COUNTRY' (TagLib's description casing; an uppercase TXXX:RELEASECOUNTRY description also reads back), MP4 freeform atom 'MusicBrainz Album Release Country', APEv2 raw RELEASECOUNTRY, ASF 'MusicBrainz/Album Release Country', WAV ICNT, Vorbis/Matroska raw RELEASECOUNTRY";
79
79
  readonly type: "string";
80
80
  readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF", "Matroska", "WAV"];
81
81
  readonly mappings: {
@@ -46,7 +46,7 @@ const SPECIALIZED_PROPERTIES = {
46
46
  },
47
47
  releaseType: {
48
48
  key: "RELEASETYPE",
49
- description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE",
49
+ description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.2 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE",
50
50
  type: "string",
51
51
  supportedFormats: [
52
52
  "ID3v2",
@@ -64,7 +64,7 @@ const SPECIALIZED_PROPERTIES = {
64
64
  },
65
65
  releaseCountry: {
66
66
  key: "RELEASECOUNTRY",
67
- description: "Release country (ISO 3166-1 code, e.g. 'US'). TagLib 2.3.1 translates the RELEASECOUNTRY key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM RELEASE COUNTRY' (TagLib's description casing; an uppercase TXXX:RELEASECOUNTRY description also reads back), MP4 freeform atom 'MusicBrainz Album Release Country', APEv2 raw RELEASECOUNTRY, ASF 'MusicBrainz/Album Release Country', WAV ICNT, Vorbis/Matroska raw RELEASECOUNTRY",
67
+ description: "Release country (ISO 3166-1 code, e.g. 'US'). TagLib 2.3.2 translates the RELEASECOUNTRY key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM RELEASE COUNTRY' (TagLib's description casing; an uppercase TXXX:RELEASECOUNTRY description also reads back), MP4 freeform atom 'MusicBrainz Album Release Country', APEv2 raw RELEASECOUNTRY, ASF 'MusicBrainz/Album Release Country', WAV ICNT, Vorbis/Matroska raw RELEASECOUNTRY",
68
68
  type: "string",
69
69
  supportedFormats: [
70
70
  "ID3v2",
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Sibling corroboration for gated disc-folder names (taglib-ys7m split).
3
+ *
4
+ * Gated names (title-word markers, single-letter tokens, bonus, bare) are
5
+ * discs only when a sibling under the same parent confirms them — an
6
+ * unconditional disc sibling, or sibling numbering of their own (a folder
7
+ * never confirms itself). Side-letter tokens corroborate each other
8
+ * ("CD D" + "CD E").
9
+ */
10
+ import type { DiscConfidence, DiscParse } from "./album-types.js";
11
+ export declare const CONFIDENCE_RANK: Record<DiscConfidence, number>;
12
+ export declare function corroborated(parse: DiscParse, siblings: string[]): boolean;
13
+ //# sourceMappingURL=album-corroborate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"album-corroborate.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-corroborate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI1D,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAoC1E"}
@@ -0,0 +1,36 @@
1
+ import { basename } from "../utils/path.js";
2
+ import { parseDiscName } from "./folder-disc.js";
3
+ const CONFIDENCE_RANK = {
4
+ low: 0,
5
+ medium: 1,
6
+ high: 2
7
+ };
8
+ function corroborated(parse, siblings) {
9
+ if (!parse.gated && parse.kind === "exact") return true;
10
+ if (siblings.length === 0) return false;
11
+ const siblingParses = siblings.map((s) => parseDiscName(basename(s))).filter((p) => p !== void 0);
12
+ const hasExactSibling = siblingParses.some(
13
+ (p) => !p.gated && p.kind === "exact"
14
+ );
15
+ const hasNumberedSibling = siblingParses.some(
16
+ (p) => p.number !== void 0
17
+ );
18
+ if (parse.number !== void 0 && hasNumberedSibling) return true;
19
+ if (!parse.gated && parse.kind === "embedded" && hasExactSibling) return true;
20
+ if (!parse.gated && parse.kind === "volume" && hasNumberedSibling) {
21
+ return true;
22
+ }
23
+ if (parse.sideLetter) {
24
+ return siblingParses.some((p) => p.sideLetter);
25
+ }
26
+ if (parse.kind === "bonus" || parse.kind === "bare") {
27
+ const numberedCount = siblingParses.filter((p) => p.number !== void 0).length;
28
+ if (numberedCount >= 2) return true;
29
+ if (parse.number !== void 0 && hasNumberedSibling) return true;
30
+ }
31
+ return false;
32
+ }
33
+ export {
34
+ CONFIDENCE_RANK,
35
+ corroborated
36
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Disc assembly and finalization (spec steps 6-7, taglib-ys7m split).
3
+ *
4
+ * Each file resolves to a disc number: the common tag value among its
5
+ * directory's files (missing abstains, disagreement falls back to the
6
+ * folder), else the folder evidence (own disc parse, ancestor, or flat
7
+ * filename prefix). Files resolving to the SAME number merge into one
8
+ * AlbumDisc, with tagDiscNumber recomputed over the merged set.
9
+ */
10
+ import type { AlbumAccumulator, AlbumGroup } from "./album-types.js";
11
+ /** Assemble discs per album, then sort discs and items (steps 6-7). */
12
+ export declare function assembleDiscs(albums: Map<AlbumAccumulator["key"], AlbumAccumulator>): AlbumGroup[];
13
+ //# sourceMappingURL=album-discs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"album-discs.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-discs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAEhB,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAE1B,uEAAuE;AACvE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC,GACrD,UAAU,EAAE,CAoKd"}
@@ -0,0 +1,122 @@
1
+ import { dirname } from "./folder-disc.js";
2
+ function assembleDiscs(albums) {
3
+ const groups = [];
4
+ for (const acc of albums.values()) {
5
+ const dirTagCommon = /* @__PURE__ */ new Map();
6
+ const resolvedByFile = /* @__PURE__ */ new Map();
7
+ for (const item of acc.items) {
8
+ const dir = dirname(item.path);
9
+ if (!dirTagCommon.has(dir)) {
10
+ const tagged = acc.items.filter((i) => dirname(i.path) === dir).map((i) => i.tags.discNumber).filter((d) => d !== void 0 && d > 0);
11
+ dirTagCommon.set(
12
+ dir,
13
+ tagged.length > 0 && tagged.every((d) => d === tagged[0]) ? tagged[0] : void 0
14
+ );
15
+ }
16
+ const evidence = acc.evidence.get(item.path);
17
+ const tagCommon = dirTagCommon.get(dir);
18
+ resolvedByFile.set(
19
+ item.path,
20
+ tagCommon ?? evidence?.folderDiscNumber
21
+ );
22
+ }
23
+ const discs = /* @__PURE__ */ new Map();
24
+ const order = [];
25
+ const noEvidenceItems = [];
26
+ for (const item of acc.items) {
27
+ const evidence = acc.evidence.get(item.path);
28
+ if (evidence === void 0) {
29
+ noEvidenceItems.push(item);
30
+ continue;
31
+ }
32
+ const resolved = resolvedByFile.get(item.path);
33
+ const discKey = resolved === void 0 ? `dir:${dirname(item.path)}` : String(resolved);
34
+ let disc = discs.get(discKey);
35
+ if (!disc) {
36
+ disc = {
37
+ discNumber: resolved,
38
+ totalDiscs: evidence.total,
39
+ folderDiscNumber: evidence.folderDiscNumber,
40
+ folderDiscTitle: evidence.folderDiscTitle,
41
+ tagDiscNumber: void 0,
42
+ confidence: evidence.confidence,
43
+ items: []
44
+ };
45
+ discs.set(discKey, disc);
46
+ order.push(discKey);
47
+ }
48
+ disc.items.push(item);
49
+ }
50
+ if (noEvidenceItems.length > 0) {
51
+ const numbered = [...discs.values()].filter((d) => d.folderDiscNumber !== void 0).sort((a, b) => a.folderDiscNumber - b.folderDiscNumber);
52
+ if (numbered.length > 0) {
53
+ numbered[0].items.push(...noEvidenceItems);
54
+ } else {
55
+ const key = "dir:__none__";
56
+ let disc = discs.get(key);
57
+ if (!disc) {
58
+ disc = {
59
+ discNumber: void 0,
60
+ totalDiscs: void 0,
61
+ folderDiscNumber: void 0,
62
+ folderDiscTitle: void 0,
63
+ tagDiscNumber: void 0,
64
+ confidence: "high",
65
+ items: []
66
+ };
67
+ discs.set(key, disc);
68
+ order.push(key);
69
+ }
70
+ disc.items.push(...noEvidenceItems);
71
+ }
72
+ }
73
+ for (const disc of discs.values()) {
74
+ const tagged = disc.items.map((i) => i.tags.discNumber).filter((d) => d !== void 0 && d > 0);
75
+ const common = tagged.length > 0 && tagged.every((d) => d === tagged[0]) ? tagged[0] : void 0;
76
+ disc.tagDiscNumber = common;
77
+ disc.discNumber = common ?? disc.folderDiscNumber;
78
+ for (const item of disc.items) item.discNumber = disc.discNumber;
79
+ }
80
+ const albumTaggedTotals = acc.items.map((i) => i.tags.totalDiscs).filter((t) => t !== void 0 && t > 0);
81
+ const commonTotal = albumTaggedTotals.length > 0 && albumTaggedTotals.every((t) => t === albumTaggedTotals[0]) ? albumTaggedTotals[0] : void 0;
82
+ const ofN = [...discs.values()].map((d) => d.totalDiscs).find(
83
+ (t) => t !== void 0
84
+ );
85
+ const maxSibling = [...discs.values()].map((d) => d.discNumber).filter((n) => n !== void 0).reduce((a, b) => Math.max(a, b), 0) || void 0;
86
+ for (const disc of discs.values()) {
87
+ disc.totalDiscs = commonTotal ?? ofN ?? maxSibling;
88
+ }
89
+ const sortedDiscs = [...discs.values()].sort((a, b) => {
90
+ const an = a.discNumber === void 0 ? -1 : a.discNumber;
91
+ const bn = b.discNumber === void 0 ? -1 : b.discNumber;
92
+ if (an !== bn) return an - bn;
93
+ return (a.folderDiscTitle ?? "").localeCompare(b.folderDiscTitle ?? "");
94
+ });
95
+ for (const disc of sortedDiscs) {
96
+ disc.items.sort((a, b) => {
97
+ const at = a.tags.track ?? Infinity;
98
+ const bt = b.tags.track ?? Infinity;
99
+ if (at !== bt) return at - bt;
100
+ return a.path.localeCompare(b.path);
101
+ });
102
+ }
103
+ const flags = acc.items.map((i) => i.tags.compilation).filter((c) => c !== void 0);
104
+ const compilation = flags.length > 0 && flags.every((f) => f === flags[0]) ? flags[0] : void 0;
105
+ const albumDirs = new Set(acc.items.map((i) => i.albumDir));
106
+ const directory = albumDirs.size === 1 ? [...albumDirs][0] : acc.directory;
107
+ groups.push({
108
+ key: acc.key,
109
+ albumArtist: acc.albumArtist,
110
+ album: acc.album,
111
+ source: acc.source,
112
+ compilation,
113
+ directory,
114
+ discs: sortedDiscs,
115
+ items: sortedDiscs.flatMap((d) => d.items)
116
+ });
117
+ }
118
+ return groups;
119
+ }
120
+ export {
121
+ assembleDiscs
122
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @fileoverview Pure album grouping over a FolderScanResult (2026-08-03 spec).
3
+ *
4
+ * Given a folder scan, produce albums with disc subdivisions, using embedded
5
+ * tags as authority and folder/filename structure as evidence. Synchronous,
6
+ * runtime-agnostic, no wasm, no I/O: everything the algorithm needs arrives
7
+ * in the scan result (tags, paths, statuses). taglib-ys7m split: disc
8
+ * recognition lives in folder-disc.ts, identity in album-identity.ts, disc
9
+ * assembly in album-discs.ts, types in album-types.ts.
10
+ *
11
+ * Model contract (invariants, enforced by tests):
12
+ * 1. Every ok item appears exactly once across albums[*].items, singles,
13
+ * and unmatched; errors is disjoint.
14
+ * 2. discs >= 1 per album; items >= 1 per disc.
15
+ * 3. discNumber === tagDiscNumber ?? folderDiscNumber on every disc.
16
+ * 4. key is stable for identical input.
17
+ * 5. Every item's albumDir/discNumber match the disc it was assigned to.
18
+ * 6. compilation is true/false only under full tag agreement, else undefined.
19
+ * 7. singles holds exactly the ok items whose resolved album has one file.
20
+ */
21
+ import type { FolderScanResult } from "./types.js";
22
+ import type { AlbumGroupingResult, GroupAlbumsOptions } from "./album-types.js";
23
+ export declare function groupAlbums(result: FolderScanResult, options?: GroupAlbumsOptions): AlbumGroupingResult;
24
+ //# sourceMappingURL=album-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"album-grouping.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAEV,mBAAmB,EAInB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AA0I1B,wBAAgB,WAAW,CACzB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,kBAAuB,GAC/B,mBAAmB,CAuCrB"}
@@ -0,0 +1,118 @@
1
+ import { basename } from "../utils/path.js";
2
+ import { dirname } from "./folder-disc.js";
3
+ import { baseConfidence, parseDiscName } from "./folder-disc.js";
4
+ import { CONFIDENCE_RANK, corroborated } from "./album-corroborate.js";
5
+ import { buildAlbumIdentity } from "./album-identity.js";
6
+ import { assembleDiscs } from "./album-discs.js";
7
+ function flatPrefix(filename) {
8
+ const separated = filename.match(/^(\d{1,2})[\s._-](\d{1,2})/);
9
+ if (separated) return { disc: parseInt(separated[1], 10), form: "separated" };
10
+ const compact = filename.match(/^(\d)(\d{2})(?:\D|$)/);
11
+ if (compact) return { disc: parseInt(compact[1], 10), form: "compact" };
12
+ return void 0;
13
+ }
14
+ function normalizeOk(result) {
15
+ const okItems = [];
16
+ const errors = [];
17
+ for (const item of result.items) {
18
+ if (item.status === "ok") {
19
+ okItems.push({ path: item.path, tags: item.tags, metadata: item });
20
+ } else {
21
+ errors.push({ path: item.path, error: item.error });
22
+ }
23
+ }
24
+ return { okItems, errors };
25
+ }
26
+ function buildTree(okItems) {
27
+ const tree = /* @__PURE__ */ new Map();
28
+ for (const item of okItems) {
29
+ const dir = dirname(item.path);
30
+ let node = tree.get(dir);
31
+ if (!node) {
32
+ node = { files: [], parent: dirname(dir) };
33
+ tree.set(dir, node);
34
+ }
35
+ node.files.push(item);
36
+ }
37
+ return tree;
38
+ }
39
+ function confirmDiscs(tree, minRank) {
40
+ const confirmedDiscs = /* @__PURE__ */ new Map();
41
+ for (const [dir, node] of tree) {
42
+ if (node.files.length === 0) continue;
43
+ const parse = parseDiscName(basename(dir));
44
+ if (!parse) continue;
45
+ const siblings = [...tree.keys()].filter(
46
+ (d) => d !== dir && dirname(d) === dirname(dir)
47
+ );
48
+ const corroboratedBySiblings = corroborated(parse, siblings);
49
+ let confidence = parse.gated ? "low" : baseConfidence(parse);
50
+ if (parse.gated) {
51
+ if (!corroboratedBySiblings) continue;
52
+ } else if (parse.kind === "bonus" || parse.kind === "bare") {
53
+ if (!corroboratedBySiblings) continue;
54
+ } else if (corroboratedBySiblings) {
55
+ confidence = "high";
56
+ }
57
+ if (CONFIDENCE_RANK[confidence] < minRank) continue;
58
+ confirmedDiscs.set(dir, { parse, confidence });
59
+ }
60
+ return confirmedDiscs;
61
+ }
62
+ function flatSubdivisions(tree, confirmedDiscs, useFlatPrefixes) {
63
+ const flat = /* @__PURE__ */ new Map();
64
+ if (!useFlatPrefixes) return flat;
65
+ for (const [dir, node] of tree) {
66
+ if (node.files.length === 0 || confirmedDiscs.has(dir)) continue;
67
+ const byFile = /* @__PURE__ */ new Map();
68
+ const forms = /* @__PURE__ */ new Set();
69
+ for (const item of node.files) {
70
+ const prefix = flatPrefix(basename(item.path));
71
+ if (prefix) {
72
+ byFile.set(item.path, prefix.disc);
73
+ forms.add(prefix.form);
74
+ }
75
+ }
76
+ if (byFile.size < 2) continue;
77
+ const distinct = [...new Set(byFile.values())].sort((a, b) => a - b);
78
+ const allCompact = forms.size === 1 && forms.has("compact");
79
+ const plausible = allCompact ? distinct.every((d) => d >= 1 && d <= distinct.length) : true;
80
+ if (plausible) flat.set(dir, byFile);
81
+ }
82
+ return flat;
83
+ }
84
+ function groupAlbums(result, options = {}) {
85
+ const minRank = CONFIDENCE_RANK[options.minFolderConfidence ?? "low"];
86
+ const useFlatPrefixes = options.flatDiscPrefixes ?? true;
87
+ const useFolderFallback = options.folderFallback ?? true;
88
+ const { okItems, errors } = normalizeOk(result);
89
+ if (okItems.length === 0) {
90
+ return { albums: [], singles: [], unmatched: [], errors };
91
+ }
92
+ const tree = buildTree(okItems);
93
+ const confirmedDiscs = confirmDiscs(tree, minRank);
94
+ const flat = flatSubdivisions(tree, confirmedDiscs, useFlatPrefixes);
95
+ const { albums, unmatched } = buildAlbumIdentity(
96
+ okItems,
97
+ confirmedDiscs,
98
+ flat,
99
+ { scanRoot: options.scanRoot, useFolderFallback }
100
+ );
101
+ const groups = assembleDiscs(albums);
102
+ const albumsOut = [];
103
+ const singles = [];
104
+ for (const group of groups) {
105
+ if (group.items.length === 1) {
106
+ singles.push(group.items[0]);
107
+ } else {
108
+ albumsOut.push(group);
109
+ }
110
+ }
111
+ albumsOut.sort(
112
+ (a, b) => (a.albumArtist ?? "").localeCompare(b.albumArtist ?? "") || (a.album ?? "").localeCompare(b.album ?? "")
113
+ );
114
+ return { albums: albumsOut, singles, unmatched, errors };
115
+ }
116
+ export {
117
+ groupAlbums
118
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Album identity resolution (spec step 5, taglib-ys7m split).
3
+ *
4
+ * Tags are authority: key on normalized (albumArtist, album), folding generic
5
+ * album artists into an album-only key. Untagged files fall back to a folder
6
+ * walk, and folder-derived groups merge into matching tag-keyed groups.
7
+ */
8
+ import type { AudioFileMetadata } from "./types.js";
9
+ import type { AlbumAccumulator, AlbumGroupKey, DiscConfidence, DiscParse, OkItem } from "./album-types.js";
10
+ type ConfirmedDiscs = Map<string, {
11
+ parse: DiscParse;
12
+ confidence: DiscConfidence;
13
+ }>;
14
+ export interface AlbumIdentity {
15
+ albums: Map<AlbumGroupKey, AlbumAccumulator>;
16
+ unmatched: AudioFileMetadata[];
17
+ }
18
+ /**
19
+ * Build the album map (spec step 5): tag-keyed groups first, folder fallback
20
+ * for untagged files, then mixed-folder merges into tag-keyed groups.
21
+ */
22
+ export declare function buildAlbumIdentity(okItems: OkItem[], confirmedDiscs: ConfirmedDiscs, flatSubdivisions: Map<string, Map<string, number>>, options: {
23
+ scanRoot?: string | undefined;
24
+ useFolderFallback: boolean;
25
+ }): AlbumIdentity;
26
+ export {};
27
+ //# sourceMappingURL=album-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"album-identity.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-identity.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,SAAS,EAET,MAAM,EACP,MAAM,kBAAkB,CAAC;AAY1B,KAAK,cAAc,GAAG,GAAG,CACvB,MAAM,EACN;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAAE,CACjD,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAC7C,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;AA6ED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EAAE,EACjB,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAClD,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,GACrE,aAAa,CAmGf"}
@@ -0,0 +1,151 @@
1
+ import { basename } from "../utils/path.js";
2
+ import { dirname } from "./folder-disc.js";
3
+ function normalizeKey(s) {
4
+ return s.trim().toLowerCase().replace(/\s+/g, " ");
5
+ }
6
+ function isGenericAlbumArtist(albumArtist) {
7
+ if (!albumArtist || albumArtist.trim() === "") return true;
8
+ const n = normalizeKey(albumArtist);
9
+ return n === "various artists" || n === "va";
10
+ }
11
+ function evidenceFor(item, confirmedDiscs, flatSubdivisions) {
12
+ const dir = dirname(item.path);
13
+ const own = confirmedDiscs.get(dir);
14
+ if (own) {
15
+ return {
16
+ folderDiscNumber: own.parse.number,
17
+ total: own.parse.total,
18
+ folderDiscTitle: own.parse.discTitle,
19
+ confidence: own.confidence,
20
+ albumDir: dirname(dir)
21
+ };
22
+ }
23
+ let cursor = dirname(dir);
24
+ while (cursor !== void 0) {
25
+ const entry = confirmedDiscs.get(cursor);
26
+ if (entry) {
27
+ return {
28
+ folderDiscNumber: entry.parse.number,
29
+ total: entry.parse.total,
30
+ folderDiscTitle: entry.parse.discTitle,
31
+ confidence: entry.confidence,
32
+ albumDir: dirname(cursor)
33
+ };
34
+ }
35
+ const parent = dirname(cursor);
36
+ if (parent === cursor) break;
37
+ cursor = parent;
38
+ }
39
+ const flat = flatSubdivisions.get(dir)?.get(item.path);
40
+ if (flat !== void 0) {
41
+ return {
42
+ folderDiscNumber: flat,
43
+ total: void 0,
44
+ folderDiscTitle: void 0,
45
+ confidence: "medium",
46
+ albumDir: dir
47
+ };
48
+ }
49
+ return void 0;
50
+ }
51
+ function folderIdentity(dir, confirmedDiscs, scanRoot) {
52
+ const own = confirmedDiscs.get(dir);
53
+ if (!own) {
54
+ const title2 = basename(dir);
55
+ return title2 ? { title: title2, titleSource: dir } : void 0;
56
+ }
57
+ if (own.parse.title !== void 0) {
58
+ return { title: own.parse.title, titleSource: dirname(dir) };
59
+ }
60
+ const source = dirname(dir);
61
+ if (source === scanRoot || source === dir) return void 0;
62
+ const title = basename(source);
63
+ return title ? { title, titleSource: source } : void 0;
64
+ }
65
+ function buildAlbumIdentity(okItems, confirmedDiscs, flatSubdivisions, options) {
66
+ const albums = /* @__PURE__ */ new Map();
67
+ const unmatched = [];
68
+ for (const item of okItems) {
69
+ const dir = dirname(item.path);
70
+ const albumTag = item.tags.album?.[0]?.trim();
71
+ const albumArtistTag = item.tags.albumArtist?.[0]?.trim();
72
+ if (albumTag) {
73
+ const artistPart = isGenericAlbumArtist(albumArtistTag) ? "" : normalizeKey(albumArtistTag ?? "");
74
+ const key2 = `${artistPart}::${normalizeKey(albumTag)}`;
75
+ let acc2 = albums.get(key2);
76
+ if (!acc2) {
77
+ acc2 = {
78
+ key: key2,
79
+ album: albumTag,
80
+ albumArtist: isGenericAlbumArtist(albumArtistTag) ? void 0 : albumArtistTag,
81
+ source: "tags",
82
+ directory: void 0,
83
+ items: [],
84
+ evidence: /* @__PURE__ */ new Map()
85
+ };
86
+ albums.set(key2, acc2);
87
+ }
88
+ const evidence2 = evidenceFor(item, confirmedDiscs, flatSubdivisions);
89
+ acc2.evidence.set(item.path, evidence2);
90
+ acc2.items.push({
91
+ ...item.metadata,
92
+ albumDir: evidence2?.albumDir ?? dir,
93
+ discNumber: evidence2?.folderDiscNumber
94
+ });
95
+ continue;
96
+ }
97
+ if (!options.useFolderFallback) {
98
+ unmatched.push(item.metadata);
99
+ continue;
100
+ }
101
+ const identity = folderIdentity(dir, confirmedDiscs, options.scanRoot);
102
+ if (!identity) {
103
+ unmatched.push(item.metadata);
104
+ continue;
105
+ }
106
+ const key = `${identity.titleSource}::${normalizeKey(identity.title)}`;
107
+ let acc = albums.get(key);
108
+ if (!acc) {
109
+ acc = {
110
+ key,
111
+ album: identity.title,
112
+ albumArtist: void 0,
113
+ source: "folder",
114
+ directory: identity.titleSource,
115
+ items: [],
116
+ evidence: /* @__PURE__ */ new Map()
117
+ };
118
+ albums.set(key, acc);
119
+ }
120
+ const evidence = evidenceFor(item, confirmedDiscs, flatSubdivisions);
121
+ acc.evidence.set(item.path, evidence);
122
+ acc.items.push({
123
+ ...item.metadata,
124
+ albumDir: evidence?.albumDir ?? dir,
125
+ discNumber: evidence?.folderDiscNumber
126
+ });
127
+ }
128
+ for (const [key, acc] of [...albums]) {
129
+ if (acc.source === "tags") continue;
130
+ for (const other of albums.values()) {
131
+ if (other === acc || other.source !== "tags") continue;
132
+ if (normalizeKey(other.album) !== normalizeKey(acc.album)) continue;
133
+ const albumDir = acc.directory;
134
+ const sharesChain = albumDir !== void 0 && other.items.some((o) => {
135
+ const od = dirname(o.path);
136
+ return od === albumDir || od.startsWith(albumDir + "/");
137
+ });
138
+ if (!sharesChain) continue;
139
+ for (const item of acc.items) {
140
+ other.items.push(item);
141
+ other.evidence.set(item.path, acc.evidence.get(item.path));
142
+ }
143
+ albums.delete(key);
144
+ break;
145
+ }
146
+ }
147
+ return { albums, unmatched };
148
+ }
149
+ export {
150
+ buildAlbumIdentity
151
+ };
@@ -1,22 +1,9 @@
1
1
  /**
2
- * @fileoverview Pure album grouping over a FolderScanResult (2026-08-03 spec).
3
- *
4
- * Given a folder scan, produce albums with disc subdivisions, using embedded
5
- * tags as authority and folder/filename structure as evidence. Synchronous,
6
- * runtime-agnostic, no wasm, no I/O: everything the algorithm needs arrives
7
- * in the scan result (tags, paths, statuses).
8
- *
9
- * Model contract (invariants, enforced by tests):
10
- * 1. Every ok item appears exactly once across albums[*].items, singles,
11
- * and unmatched; errors is disjoint.
12
- * 2. discs >= 1 per album; items >= 1 per disc.
13
- * 3. discNumber === tagDiscNumber ?? folderDiscNumber on every disc.
14
- * 4. key is stable for identical input.
15
- * 5. Every item's albumDir/discNumber match the disc it was assigned to.
16
- * 6. compilation is true/false only under full tag agreement, else undefined.
17
- * 7. singles holds exactly the ok items whose resolved album has one file.
2
+ * Types for pure album grouping (taglib-ys7m split). No runtime imports:
3
+ * every module in the disc-folder graph must stay Wasm-free (taglib-cd7b).
18
4
  */
19
- import type { AudioFileMetadata, FolderScanResult } from "./types.js";
5
+ import type { AudioFileMetadata } from "./types.js";
6
+ /** Opaque, stable album identity. */
20
7
  export type AlbumGroupKey = string & {
21
8
  __brand: "AlbumGroupKey";
22
9
  };
@@ -111,12 +98,54 @@ export interface DiscFolderInfo {
111
98
  * "high" inside groupAlbums. Gated names stay "low" even corroborated. */
112
99
  confidence: DiscConfidence;
113
100
  }
114
- /**
115
- * Recognize a directory name as a disc folder. Standalone — it only
116
- * classifies the name; it does not resolve the folder to its parent (use
117
- * the album result's per-file `albumDir` for that). Returns undefined for
118
- * non-disc names. Plain "Bonus" and "Extras" are never discs by name.
119
- */
120
- export declare function discFolderInfo(name: string): DiscFolderInfo | undefined;
121
- export declare function groupAlbums(result: FolderScanResult, options?: GroupAlbumsOptions): AlbumGroupingResult;
122
- //# sourceMappingURL=group-albums.d.ts.map
101
+ export type DiscKind = "exact" | "embedded" | "volume" | "bonus" | "bare";
102
+ export interface DiscParse {
103
+ kind: DiscKind;
104
+ /** Disc number when the name carries one. */
105
+ number: number | undefined;
106
+ /** "of N" total from "CD 1 of 2". */
107
+ total: number | undefined;
108
+ /** Title text before an embedded marker ("Album (Disc 1)" -> "Album"). */
109
+ title: string | undefined;
110
+ /** Trailing text after the number ("Bonus Tracks" from "Disc 2 (Bonus Tracks)"). */
111
+ discTitle: string | undefined;
112
+ /** True for title-word markers (tape/vinyl/cassette/lp/record) and
113
+ * single-letter number tokens: corroboration required, low confidence. */
114
+ gated: boolean;
115
+ /** True when the number token was a single letter ("CD D"): a side label,
116
+ * not a number — corroboration required (2026-08-04 feedback). */
117
+ sideLetter: boolean;
118
+ /** True when the number token was arabic digits ("CD1" vs "Disc One"). */
119
+ digit: boolean;
120
+ }
121
+ export interface OkItem {
122
+ path: string;
123
+ tags: AudioFileMetadata["tags"];
124
+ metadata: AudioFileMetadata;
125
+ }
126
+ export interface DirNode {
127
+ files: OkItem[];
128
+ parent: string | undefined;
129
+ }
130
+ /** Per-file disc evidence, resolved before tag merging. */
131
+ export interface FileDiscEvidence {
132
+ /** Folder-derived disc number (own/ancestor parse or flat prefix). */
133
+ folderDiscNumber: number | undefined;
134
+ /** "of N" total from the folder name. */
135
+ total: number | undefined;
136
+ folderDiscTitle: string | undefined;
137
+ confidence: DiscConfidence;
138
+ /** The album directory attributed to this file. */
139
+ albumDir: string;
140
+ }
141
+ /** Accumulator for one album during identity and disc assembly. */
142
+ export interface AlbumAccumulator {
143
+ key: AlbumGroupKey;
144
+ album: string;
145
+ albumArtist: string | undefined;
146
+ source: "tags" | "folder";
147
+ directory: string | undefined;
148
+ items: AlbumGroupItem[];
149
+ evidence: Map<string, FileDiscEvidence | undefined>;
150
+ }
151
+ //# sourceMappingURL=album-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"album-types.d.ts","sourceRoot":"","sources":["../../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