@sequencemedia/music-library 1.1.1 → 1.1.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.
package/app.mjs CHANGED
@@ -16,6 +16,14 @@ import {
16
16
 
17
17
  import * as watch from '#music-library/watch'
18
18
 
19
+ const {
20
+ env: {
21
+ DEBUG = '@sequencemedia/music-library*,@sequencemedia/music-library-parser*'
22
+ }
23
+ } = process
24
+
25
+ if (DEBUG) debug.enable(DEBUG)
26
+
19
27
  const {
20
28
  library,
21
29
  library: {
@@ -34,7 +42,7 @@ const NAME = 'ml.App'
34
42
  process.title = NAME
35
43
 
36
44
  async function app () {
37
- const PACKAGE = JSON.parse(await readFile('./package.json'))
45
+ const PACKAGE = JSON.parse(await readFile('./package.json', 'utf8'))
38
46
 
39
47
  const {
40
48
  name
@@ -56,7 +64,7 @@ async function app () {
56
64
  pid
57
65
  } = a.find(({ pid }) => pid !== PID)
58
66
 
59
- const log = debug('@sequencemedia/music-library:process:log')
67
+ const log = debug('@sequencemedia/music-library:process')
60
68
 
61
69
  log(`Killing application "${name}" in process ${pid}.`)
62
70
 
@@ -129,17 +137,17 @@ async function app () {
129
137
  if (l) {
130
138
  log(`Application "${name}" in process ${pid} watching Library.`)
131
139
 
132
- await library.toM3U(jar, xml, destination)
140
+ library.toM3U(jar, xml, destination)
133
141
  } else {
134
142
  if (t) {
135
143
  log(`Application "${name}" in process ${pid} watching Tracks.`)
136
144
 
137
- await tracks.toM3U(jar, xml, destination)
145
+ tracks.toM3U(jar, xml, destination)
138
146
  } else {
139
147
  if (p) {
140
148
  log(`Application "${name}" in process ${pid} watching Playlists.`)
141
149
 
142
- await playlists.toM3U(jar, xml, destination)
150
+ playlists.toM3U(jar, xml, destination)
143
151
  }
144
152
  }
145
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/music-library",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Watch Apple Music Library XML and parse to JSON, JS, ES, or M3U",
5
5
  "keywords": [
6
6
  "music",
@@ -36,14 +36,14 @@
36
36
  "url": "https://github.com/sequencemedia/music-library/issues"
37
37
  },
38
38
  "scripts": {
39
- "dev": "cross-env DEBUG=@sequencemedia/music-library,@sequencemedia/music-library:*,@sequencemedia/music-library-parser,@sequencemedia/music-library-parser:* NODE_ENV=development node .",
39
+ "dev": "cross-env NODE_ENV=development node .",
40
40
  "lint": "eslint .",
41
41
  "lint:fix": "npm run lint -- --fix",
42
42
  "prepare": "husky",
43
- "start": "cross-env DEBUG=@sequencemedia/music-library,@sequencemedia/music-library:*,@sequencemedia/music-library-parser,@sequencemedia/music-library-parser:* NODE_ENV=production node ."
43
+ "start": "cross-env NODE_OPTIONS=\"--no-warnings\" NODE_ENV=production node ."
44
44
  },
45
45
  "dependencies": {
46
- "@sequencemedia/music-library-parser": "1.1.1",
46
+ "@sequencemedia/music-library-parser": "1.1.3",
47
47
  "chokidar": "^3.6.0",
48
48
  "commander": "^12.1.0",
49
49
  "cross-env": "^7.0.3",
@@ -10,8 +10,11 @@ const {
10
10
  }
11
11
  } = musicLibraryParser
12
12
 
13
+ const log = debug('@sequencemedia/music-library')
13
14
  const error = debug('@sequencemedia/music-library:error')
14
15
 
16
+ log('`music-library` is awake')
17
+
15
18
  export async function toM3U (jar, xml, destination) {
16
19
  try {
17
20
  const j = jar
@@ -26,7 +29,9 @@ export async function toM3U (jar, xml, destination) {
26
29
  ? normalise(destination)
27
30
  : destination
28
31
 
29
- return await parseToM3U(j, x, d)
32
+ return (
33
+ await parseToM3U(j, x, d)
34
+ )
30
35
  } catch ({ message }) {
31
36
  error(message)
32
37
  }
@@ -12,8 +12,11 @@ const {
12
12
  }
13
13
  } = musicLibraryParser
14
14
 
15
+ const log = debug('@sequencemedia/music-library')
15
16
  const error = debug('@sequencemedia/music-library:error')
16
17
 
18
+ log('`music-library` is awake')
19
+
17
20
  export async function toM3U (jar, xml, destination) {
18
21
  try {
19
22
  const j = jar
@@ -28,7 +31,9 @@ export async function toM3U (jar, xml, destination) {
28
31
  ? normalise(destination)
29
32
  : destination
30
33
 
31
- return await parseToM3U(j, x, d)
34
+ return (
35
+ await parseToM3U(j, x, d)
36
+ )
32
37
  } catch ({ message }) {
33
38
  error(message)
34
39
  }
@@ -16,8 +16,11 @@ const {
16
16
  }
17
17
  } = musicLibraryParser
18
18
 
19
+ const log = debug('@sequencemedia/music-library:transform')
19
20
  const error = debug('@sequencemedia/music-library:transform:error')
20
21
 
22
+ log('`music-library` is awake')
23
+
21
24
  export async function toJSON (jar, xml) {
22
25
  try {
23
26
  const j = jar
@@ -28,7 +31,9 @@ export async function toJSON (jar, xml) {
28
31
  ? normalise(xml)
29
32
  : xml
30
33
 
31
- return await transformToJSON(j, x)
34
+ return (
35
+ await transformToJSON(j, x)
36
+ )
32
37
  } catch ({ message }) {
33
38
  error(message)
34
39
  }
@@ -44,7 +49,9 @@ export async function toJS (jar, xml) {
44
49
  ? normalise(xml)
45
50
  : xml
46
51
 
47
- return await transformToJS(j, x)
52
+ return (
53
+ await transformToJS(j, x)
54
+ )
48
55
  } catch ({ message }) {
49
56
  error(message)
50
57
  }
@@ -60,7 +67,9 @@ export async function toES (jar, xml) {
60
67
  ? normalise(xml)
61
68
  : xml
62
69
 
63
- return await transformToES(j, x)
70
+ return (
71
+ await transformToES(j, x)
72
+ )
64
73
  } catch ({ message }) {
65
74
  error(message)
66
75
  }
@@ -12,8 +12,11 @@ const {
12
12
  }
13
13
  } = musicLibraryParser
14
14
 
15
+ const log = debug('@sequencemedia/music-library')
15
16
  const error = debug('@sequencemedia/music-library:error')
16
17
 
18
+ log('`music-library` is awake')
19
+
17
20
  export async function toM3U (jar, xml, destination) {
18
21
  try {
19
22
  const j = jar
@@ -28,7 +31,9 @@ export async function toM3U (jar, xml, destination) {
28
31
  ? normalise(destination)
29
32
  : destination
30
33
 
31
- return await parseToM3U(j, x, d)
34
+ return (
35
+ await parseToM3U(j, x, d)
36
+ )
32
37
  } catch ({ message }) {
33
38
  error(message)
34
39
  }
@@ -16,8 +16,11 @@ const {
16
16
  }
17
17
  } = musicLibraryParser
18
18
 
19
+ const log = debug('@sequencemedia/music-library:transform')
19
20
  const error = debug('@sequencemedia/music-library:transform:error')
20
21
 
22
+ log('`music-library` is awake')
23
+
21
24
  export async function toJSON (jar, xml) {
22
25
  try {
23
26
  const j = jar
@@ -28,7 +31,9 @@ export async function toJSON (jar, xml) {
28
31
  ? normalise(xml)
29
32
  : xml
30
33
 
31
- return await transformToJSON(j, x)
34
+ return (
35
+ await transformToJSON(j, x)
36
+ )
32
37
  } catch ({ message }) {
33
38
  error(message)
34
39
  }
@@ -44,7 +49,9 @@ export async function toJS (jar, xml) {
44
49
  ? normalise(xml)
45
50
  : xml
46
51
 
47
- return await transformToJS(j, x)
52
+ return (
53
+ await transformToJS(j, x)
54
+ )
48
55
  } catch ({ message }) {
49
56
  error(message)
50
57
  }
@@ -60,7 +67,9 @@ export async function toES (jar, xml) {
60
67
  ? normalise(xml)
61
68
  : xml
62
69
 
63
- return await transformToES(j, x)
70
+ return (
71
+ await transformToES(j, x)
72
+ )
64
73
  } catch ({ message }) {
65
74
  error(message)
66
75
  }
@@ -14,8 +14,11 @@ const {
14
14
  }
15
15
  } = musicLibraryParser
16
16
 
17
+ const log = debug('@sequencemedia/music-library:transform')
17
18
  const error = debug('@sequencemedia/music-library:transform:error')
18
19
 
20
+ log('`music-library` is awake')
21
+
19
22
  export async function toJSON (jar, xml) {
20
23
  try {
21
24
  const j = jar
@@ -26,7 +29,9 @@ export async function toJSON (jar, xml) {
26
29
  ? normalise(xml)
27
30
  : xml
28
31
 
29
- return await transformToJSON(j, x)
32
+ return (
33
+ await transformToJSON(j, x)
34
+ )
30
35
  } catch ({ message }) {
31
36
  error(message)
32
37
  }
@@ -42,7 +47,9 @@ export async function toJS (jar, xml) {
42
47
  ? normalise(xml)
43
48
  : xml
44
49
 
45
- return await transformToJS(j, x)
50
+ return (
51
+ await transformToJS(j, x)
52
+ )
46
53
  } catch ({ message }) {
47
54
  error(message)
48
55
  }
@@ -58,7 +65,9 @@ export async function toES (jar, xml) {
58
65
  ? normalise(xml)
59
66
  : xml
60
67
 
61
- return await transformToES(j, x)
68
+ return (
69
+ await transformToES(j, x)
70
+ )
62
71
  } catch ({ message }) {
63
72
  error(message)
64
73
  }
@@ -15,6 +15,8 @@ const {
15
15
  const log = debug('@sequencemedia/music-library:library')
16
16
  const error = debug('@sequencemedia/music-library:library:error')
17
17
 
18
+ log('`music-library` is awake')
19
+
18
20
  export function toM3U (jar, xml, destination) {
19
21
  const j = jar
20
22
  ? normalise(jar)
@@ -17,6 +17,8 @@ const {
17
17
  const log = debug('@sequencemedia/music-library:playlists')
18
18
  const error = debug('@sequencemedia/music-library:playlists:error')
19
19
 
20
+ log('`music-library` is awake')
21
+
20
22
  export function toM3U (jar, xml, destination) {
21
23
  const j = jar
22
24
  ? normalise(jar)
@@ -18,8 +18,11 @@ const {
18
18
  }
19
19
  } = musicLibraryParser
20
20
 
21
+ const log = debug('@sequencemedia/music-library:transform')
21
22
  const error = debug('@sequencemedia/music-library:transform:error')
22
23
 
24
+ log('`music-library` is awake')
25
+
23
26
  export function toJSON (jar, xml, func = () => {}) {
24
27
  const j = jar
25
28
  ? normalise(jar)
@@ -17,6 +17,8 @@ const {
17
17
  const log = debug('@sequencemedia/music-library:tracks')
18
18
  const error = debug('@sequencemedia/music-library:tracks:error')
19
19
 
20
+ log('`music-library` is awake')
21
+
20
22
  export function toM3U (jar, xml, destination) {
21
23
  const j = jar
22
24
  ? normalise(jar)
@@ -18,8 +18,11 @@ const {
18
18
  }
19
19
  } = musicLibraryParser
20
20
 
21
+ const log = debug('@sequencemedia/music-library:transform')
21
22
  const error = debug('@sequencemedia/music-library:transform:error')
22
23
 
24
+ log('`music-library` is awake')
25
+
23
26
  export function toJSON (jar, xml, func = () => {}) {
24
27
  const j = jar
25
28
  ? normalise(jar)
@@ -16,8 +16,11 @@ const {
16
16
  }
17
17
  } = musicLibraryParser
18
18
 
19
+ const log = debug('@sequencemedia/music-library:transform')
19
20
  const error = debug('@sequencemedia/music-library:transform:error')
20
21
 
22
+ log('`music-library` is awake')
23
+
21
24
  export function toJSON (jar, xml, func = () => {}) {
22
25
  const j = jar
23
26
  ? normalise(jar)