@sequencemedia/music-library-parser 1.1.104 → 1.1.106
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/package.json +5 -7
- package/src/js/library/index.mjs +11 -7
- package/src/js/library/playlists/index.mjs +11 -7
- package/src/js/library/playlists/transform/index.mjs +13 -9
- package/src/js/library/tracks/index.mjs +11 -7
- package/src/js/library/tracks/transform/index.mjs +13 -9
- package/src/js/library/transform/index.mjs +13 -9
- package/where-am-i.mjs +9 -0
- package/babel.config.cjs +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/music-library-parser",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.106",
|
|
4
4
|
"description": "Parse Apple Music Library XML to JSON, JS, ES, or M3U",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"music",
|
|
@@ -48,16 +48,14 @@
|
|
|
48
48
|
"rimraf": "^6.0.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@babel/preset-env": "^7.27.2",
|
|
53
|
-
"@sequencemedia/eslint-config-standard": "^0.2.55",
|
|
54
|
-
"core-js": "^3.42.0",
|
|
51
|
+
"@sequencemedia/eslint-config-standard": "^0.2.56",
|
|
55
52
|
"eslint": "^9.26.0",
|
|
56
|
-
"globals": "^16.
|
|
53
|
+
"globals": "^16.1.0",
|
|
57
54
|
"husky": "^9.1.7"
|
|
58
55
|
},
|
|
59
56
|
"imports": {
|
|
60
57
|
"#music-library-parser": "./src/js/index.mjs",
|
|
61
|
-
"#music-library-parser/*": "./src/js/*/index.mjs"
|
|
58
|
+
"#music-library-parser/*": "./src/js/*/index.mjs",
|
|
59
|
+
"#where-am-i": "./where-am-i.mjs"
|
|
62
60
|
}
|
|
63
61
|
}
|
package/src/js/library/index.mjs
CHANGED
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import debug from 'debug'
|
|
12
11
|
|
|
@@ -14,19 +13,24 @@ import {
|
|
|
14
13
|
clear
|
|
15
14
|
} from '#music-library-parser'
|
|
16
15
|
|
|
16
|
+
import hereIAm from '#where-am-i'
|
|
17
|
+
|
|
17
18
|
const log = debug('@sequencemedia/music-library-parser:to-m3u')
|
|
18
19
|
const error = debug('@sequencemedia/music-library-parser:to-m3u:error')
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
-
const xsl = path.resolve(cwd, 'src/xsl/library.xsl')
|
|
21
|
+
const xsl = join(hereIAm, 'src/xsl/library.xsl')
|
|
22
22
|
|
|
23
23
|
let immediate = null
|
|
24
24
|
const queue = []
|
|
25
25
|
|
|
26
26
|
export function parse (jar, xml, destination = './Music Library') {
|
|
27
|
+
const j = resolve(jar)
|
|
28
|
+
const x = resolve(xml)
|
|
29
|
+
const d = resolve(destination)
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
32
|
new Promise((resolve, reject) => {
|
|
29
|
-
exec(`java -jar "${
|
|
33
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" destination="${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
30
34
|
})
|
|
31
35
|
)
|
|
32
36
|
}
|
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import debug from 'debug'
|
|
12
11
|
|
|
@@ -14,19 +13,24 @@ import {
|
|
|
14
13
|
clear
|
|
15
14
|
} from '#music-library-parser'
|
|
16
15
|
|
|
16
|
+
import hereIAm from '#where-am-i'
|
|
17
|
+
|
|
17
18
|
const log = debug('@sequencemedia/music-library-parser:to-m3u')
|
|
18
19
|
const error = debug('@sequencemedia/music-library-parser:to-m3u:error')
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
-
const xsl = path.resolve(cwd, 'src/xsl/library/playlists.xsl')
|
|
21
|
+
const xsl = join(hereIAm, 'src/xsl/library/playlists.xsl')
|
|
22
22
|
|
|
23
23
|
let immediate = null
|
|
24
24
|
const queue = []
|
|
25
25
|
|
|
26
26
|
export function parse (jar, xml, destination = './Music Library') {
|
|
27
|
+
const j = resolve(jar)
|
|
28
|
+
const x = resolve(xml)
|
|
29
|
+
const d = resolve(destination)
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
32
|
new Promise((resolve, reject) => {
|
|
29
|
-
exec(`java -jar "${
|
|
33
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" destination="${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
30
34
|
})
|
|
31
35
|
)
|
|
32
36
|
}
|
|
@@ -2,15 +2,14 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
readFile
|
|
13
|
-
} from 'fs/promises'
|
|
12
|
+
} from 'node:fs/promises'
|
|
14
13
|
|
|
15
14
|
import debug from 'debug'
|
|
16
15
|
|
|
@@ -18,19 +17,24 @@ import {
|
|
|
18
17
|
transform
|
|
19
18
|
} from '#music-library-parser/transform'
|
|
20
19
|
|
|
20
|
+
import hereIAm from '#where-am-i'
|
|
21
|
+
|
|
21
22
|
const error = debug('@sequencemedia/music-library-parser:to-json:error')
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const DESTINATION = path.resolve(cwd, '.music-library/playlists.json')
|
|
24
|
+
const xsl = join(hereIAm, 'src/xsl/library/tracks/to-json.xsl')
|
|
25
|
+
const DESTINATION = join(hereIAm, '.music-library/playlists.json')
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* `maxBuffer`
|
|
29
29
|
*/
|
|
30
30
|
export function parse (jar, xml, destination = DESTINATION) {
|
|
31
|
+
const j = resolve(jar)
|
|
32
|
+
const x = resolve(xml)
|
|
33
|
+
const d = resolve(destination)
|
|
34
|
+
|
|
31
35
|
return (
|
|
32
36
|
new Promise((resolve, reject) => {
|
|
33
|
-
exec(`java -jar "${
|
|
37
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" -o:"${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
34
38
|
})
|
|
35
39
|
)
|
|
36
40
|
}
|
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import debug from 'debug'
|
|
12
11
|
|
|
@@ -14,19 +13,24 @@ import {
|
|
|
14
13
|
clear
|
|
15
14
|
} from '#music-library-parser'
|
|
16
15
|
|
|
16
|
+
import hereIAm from '#where-am-i'
|
|
17
|
+
|
|
17
18
|
const log = debug('@sequencemedia/music-library-parser:to-m3u')
|
|
18
19
|
const error = debug('@sequencemedia/music-library-parser:to-m3u:error')
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
-
const xsl = path.resolve(cwd, 'src/xsl/library/tracks.xsl')
|
|
21
|
+
const xsl = join(hereIAm, 'src/xsl/library/tracks.xsl')
|
|
22
22
|
|
|
23
23
|
let immediate = null
|
|
24
24
|
const queue = []
|
|
25
25
|
|
|
26
26
|
export function parse (jar, xml, destination = './Music Library') {
|
|
27
|
+
const j = resolve(jar)
|
|
28
|
+
const x = resolve(xml)
|
|
29
|
+
const d = resolve(destination)
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
32
|
new Promise((resolve, reject) => {
|
|
29
|
-
exec(`java -jar "${
|
|
33
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" destination="${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
30
34
|
})
|
|
31
35
|
)
|
|
32
36
|
}
|
|
@@ -2,15 +2,14 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
readFile
|
|
13
|
-
} from 'fs/promises'
|
|
12
|
+
} from 'node:fs/promises'
|
|
14
13
|
|
|
15
14
|
import debug from 'debug'
|
|
16
15
|
|
|
@@ -18,19 +17,24 @@ import {
|
|
|
18
17
|
transform
|
|
19
18
|
} from '#music-library-parser/transform'
|
|
20
19
|
|
|
20
|
+
import hereIAm from '#where-am-i'
|
|
21
|
+
|
|
21
22
|
const error = debug('@sequencemedia/music-library-parser:to-json:error')
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const DESTINATION = path.resolve(cwd, '.music-library/tracks.json')
|
|
24
|
+
const xsl = join(hereIAm, 'src/xsl/library/tracks/to-json.xsl')
|
|
25
|
+
const DESTINATION = join(hereIAm, '.music-library/tracks.json')
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* `maxBuffer`
|
|
29
29
|
*/
|
|
30
30
|
export function parse (jar, xml, destination = DESTINATION) {
|
|
31
|
+
const j = resolve(jar)
|
|
32
|
+
const x = resolve(xml)
|
|
33
|
+
const d = resolve(destination)
|
|
34
|
+
|
|
31
35
|
return (
|
|
32
36
|
new Promise((resolve, reject) => {
|
|
33
|
-
exec(`java -jar "${
|
|
37
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" -o:"${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
34
38
|
})
|
|
35
39
|
)
|
|
36
40
|
}
|
|
@@ -2,15 +2,14 @@ import {
|
|
|
2
2
|
exec
|
|
3
3
|
} from 'node:child_process'
|
|
4
4
|
|
|
5
|
-
import path from 'path'
|
|
6
|
-
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
resolve,
|
|
7
|
+
join
|
|
8
|
+
} from 'node:path'
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
readFile
|
|
13
|
-
} from 'fs/promises'
|
|
12
|
+
} from 'node:fs/promises'
|
|
14
13
|
|
|
15
14
|
import debug from 'debug'
|
|
16
15
|
|
|
@@ -18,19 +17,24 @@ import {
|
|
|
18
17
|
transform
|
|
19
18
|
} from '#music-library-parser/transform'
|
|
20
19
|
|
|
20
|
+
import hereIAm from '#where-am-i'
|
|
21
|
+
|
|
21
22
|
const error = debug('@sequencemedia/music-library-parser:to-json:error')
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const DESTINATION = path.resolve(cwd, '.music-library.json')
|
|
24
|
+
const xsl = join(hereIAm, 'src/xsl/library/to-json.xsl')
|
|
25
|
+
const DESTINATION = join(hereIAm, '.music-library.json')
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* `maxBuffer`
|
|
29
29
|
*/
|
|
30
30
|
export function parse (jar, xml, destination = DESTINATION) {
|
|
31
|
+
const j = resolve(jar)
|
|
32
|
+
const x = resolve(xml)
|
|
33
|
+
const d = resolve(destination)
|
|
34
|
+
|
|
31
35
|
return (
|
|
32
36
|
new Promise((resolve, reject) => {
|
|
33
|
-
exec(`java -jar "${
|
|
37
|
+
exec(`java -jar "${j}" -s:"${x}" -xsl:"${xsl}" -o:"${d}"`, { cwd: hereIAm }, (e) => (!e) ? resolve() : reject(e))
|
|
34
38
|
})
|
|
35
39
|
)
|
|
36
40
|
}
|
package/where-am-i.mjs
ADDED