@sequencemedia/music-library 1.0.1 → 1.0.5

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.
@@ -1,37 +1,37 @@
1
- import debug from 'debug'
2
-
3
- import * as musicLibraryParser from '@sequencemedia/music-library-parser'
4
-
5
- import normalise from '#music-library/common/normalise'
6
-
7
- const {
8
- library: {
9
- playlists: {
10
- toM3U: parseToM3U
11
- }
12
- }
13
- } = musicLibraryParser
14
-
15
- const error = debug('@sequencemedia/music-library:error')
16
-
17
- export async function toM3U (jar, xml, destination) {
18
- try {
19
- const j = jar
20
- ? normalise(jar)
21
- : jar
22
-
23
- const x = xml
24
- ? normalise(xml)
25
- : xml
26
-
27
- const d = destination
28
- ? normalise(destination)
29
- : destination
30
-
31
- return await parseToM3U(j, x, d)
32
- } catch ({ message }) {
33
- error(message)
34
- }
35
- }
36
-
37
- export * as transform from './transform'
1
+ import debug from 'debug'
2
+
3
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
4
+
5
+ import normalise from '#music-library/common/normalise'
6
+
7
+ const {
8
+ library: {
9
+ playlists: {
10
+ toM3U: parseToM3U
11
+ }
12
+ }
13
+ } = musicLibraryParser
14
+
15
+ const error = debug('@sequencemedia/music-library:error')
16
+
17
+ export async function toM3U (jar, xml, destination) {
18
+ try {
19
+ const j = jar
20
+ ? normalise(jar)
21
+ : jar
22
+
23
+ const x = xml
24
+ ? normalise(xml)
25
+ : xml
26
+
27
+ const d = destination
28
+ ? normalise(destination)
29
+ : destination
30
+
31
+ return await parseToM3U(j, x, d)
32
+ } catch ({ message }) {
33
+ error(message)
34
+ }
35
+ }
36
+
37
+ export * as transform from '#music-library/library/playlists/transform'
@@ -1,67 +1,67 @@
1
- import debug from 'debug'
2
-
3
- import * as musicLibraryParser from '@sequencemedia/music-library-parser'
4
-
5
- import normalise from '#music-library/common/normalise'
6
-
7
- const {
8
- library: {
9
- playlists: {
10
- transform: {
11
- toJSON: transformToJSON,
12
- toJS: transformToJS,
13
- toES: transformToES
14
- }
15
- }
16
- }
17
- } = musicLibraryParser
18
-
19
- const error = debug('@sequencemedia/music-library:transform:error')
20
-
21
- export async function toJSON (jar, xml) {
22
- try {
23
- const j = jar
24
- ? normalise(jar)
25
- : jar
26
-
27
- const x = xml
28
- ? normalise(xml)
29
- : xml
30
-
31
- return await transformToJSON(j, x)
32
- } catch ({ message }) {
33
- error(message)
34
- }
35
- }
36
-
37
- export async function toJS (jar, xml) {
38
- try {
39
- const j = jar
40
- ? normalise(jar)
41
- : jar
42
-
43
- const x = xml
44
- ? normalise(xml)
45
- : xml
46
-
47
- return await transformToJS(j, x)
48
- } catch ({ message }) {
49
- error(message)
50
- }
51
- }
52
-
53
- export async function toES (jar, xml) {
54
- try {
55
- const j = jar
56
- ? normalise(jar)
57
- : jar
58
-
59
- const x = xml
60
- ? normalise(xml)
61
- : xml
62
-
63
- return await transformToES(j, x)
64
- } catch ({ message }) {
65
- error(message)
66
- }
67
- }
1
+ import debug from 'debug'
2
+
3
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
4
+
5
+ import normalise from '#music-library/common/normalise'
6
+
7
+ const {
8
+ library: {
9
+ playlists: {
10
+ transform: {
11
+ toJSON: transformToJSON,
12
+ toJS: transformToJS,
13
+ toES: transformToES
14
+ }
15
+ }
16
+ }
17
+ } = musicLibraryParser
18
+
19
+ const error = debug('@sequencemedia/music-library:transform:error')
20
+
21
+ export async function toJSON (jar, xml) {
22
+ try {
23
+ const j = jar
24
+ ? normalise(jar)
25
+ : jar
26
+
27
+ const x = xml
28
+ ? normalise(xml)
29
+ : xml
30
+
31
+ return await transformToJSON(j, x)
32
+ } catch ({ message }) {
33
+ error(message)
34
+ }
35
+ }
36
+
37
+ export async function toJS (jar, xml) {
38
+ try {
39
+ const j = jar
40
+ ? normalise(jar)
41
+ : jar
42
+
43
+ const x = xml
44
+ ? normalise(xml)
45
+ : xml
46
+
47
+ return await transformToJS(j, x)
48
+ } catch ({ message }) {
49
+ error(message)
50
+ }
51
+ }
52
+
53
+ export async function toES (jar, xml) {
54
+ try {
55
+ const j = jar
56
+ ? normalise(jar)
57
+ : jar
58
+
59
+ const x = xml
60
+ ? normalise(xml)
61
+ : xml
62
+
63
+ return await transformToES(j, x)
64
+ } catch ({ message }) {
65
+ error(message)
66
+ }
67
+ }
@@ -1,37 +1,37 @@
1
- import debug from 'debug'
2
-
3
- import * as musicLibraryParser from '@sequencemedia/music-library-parser'
4
-
5
- import normalise from '#music-library/common/normalise'
6
-
7
- const {
8
- library: {
9
- tracks: {
10
- toM3U: parseToM3U
11
- }
12
- }
13
- } = musicLibraryParser
14
-
15
- const error = debug('@sequencemedia/music-library:error')
16
-
17
- export async function toM3U (jar, xml, destination) {
18
- try {
19
- const j = jar
20
- ? normalise(jar)
21
- : jar
22
-
23
- const x = xml
24
- ? normalise(xml)
25
- : xml
26
-
27
- const d = destination
28
- ? normalise(destination)
29
- : destination
30
-
31
- return await parseToM3U(j, x, d)
32
- } catch ({ message }) {
33
- error(message)
34
- }
35
- }
36
-
37
- export * as transform from './transform'
1
+ import debug from 'debug'
2
+
3
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
4
+
5
+ import normalise from '#music-library/common/normalise'
6
+
7
+ const {
8
+ library: {
9
+ tracks: {
10
+ toM3U: parseToM3U
11
+ }
12
+ }
13
+ } = musicLibraryParser
14
+
15
+ const error = debug('@sequencemedia/music-library:error')
16
+
17
+ export async function toM3U (jar, xml, destination) {
18
+ try {
19
+ const j = jar
20
+ ? normalise(jar)
21
+ : jar
22
+
23
+ const x = xml
24
+ ? normalise(xml)
25
+ : xml
26
+
27
+ const d = destination
28
+ ? normalise(destination)
29
+ : destination
30
+
31
+ return await parseToM3U(j, x, d)
32
+ } catch ({ message }) {
33
+ error(message)
34
+ }
35
+ }
36
+
37
+ export * as transform from '#music-library/library/tracks/transform'
@@ -1,67 +1,67 @@
1
- import debug from 'debug'
2
-
3
- import * as musicLibraryParser from '@sequencemedia/music-library-parser'
4
-
5
- import normalise from '#music-library/common/normalise'
6
-
7
- const {
8
- library: {
9
- tracks: {
10
- transform: {
11
- toJSON: transformToJSON,
12
- toJS: transformToJS,
13
- toES: transformToES
14
- }
15
- }
16
- }
17
- } = musicLibraryParser
18
-
19
- const error = debug('@sequencemedia/music-library:transform:error')
20
-
21
- export async function toJSON (jar, xml) {
22
- try {
23
- const j = jar
24
- ? normalise(jar)
25
- : jar
26
-
27
- const x = xml
28
- ? normalise(xml)
29
- : xml
30
-
31
- return await transformToJSON(j, x)
32
- } catch ({ message }) {
33
- error(message)
34
- }
35
- }
36
-
37
- export async function toJS (jar, xml) {
38
- try {
39
- const j = jar
40
- ? normalise(jar)
41
- : jar
42
-
43
- const x = xml
44
- ? normalise(xml)
45
- : xml
46
-
47
- return await transformToJS(j, x)
48
- } catch ({ message }) {
49
- error(message)
50
- }
51
- }
52
-
53
- export async function toES (jar, xml) {
54
- try {
55
- const j = jar
56
- ? normalise(jar)
57
- : jar
58
-
59
- const x = xml
60
- ? normalise(xml)
61
- : xml
62
-
63
- return await transformToES(j, x)
64
- } catch ({ message }) {
65
- error(message)
66
- }
67
- }
1
+ import debug from 'debug'
2
+
3
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
4
+
5
+ import normalise from '#music-library/common/normalise'
6
+
7
+ const {
8
+ library: {
9
+ tracks: {
10
+ transform: {
11
+ toJSON: transformToJSON,
12
+ toJS: transformToJS,
13
+ toES: transformToES
14
+ }
15
+ }
16
+ }
17
+ } = musicLibraryParser
18
+
19
+ const error = debug('@sequencemedia/music-library:transform:error')
20
+
21
+ export async function toJSON (jar, xml) {
22
+ try {
23
+ const j = jar
24
+ ? normalise(jar)
25
+ : jar
26
+
27
+ const x = xml
28
+ ? normalise(xml)
29
+ : xml
30
+
31
+ return await transformToJSON(j, x)
32
+ } catch ({ message }) {
33
+ error(message)
34
+ }
35
+ }
36
+
37
+ export async function toJS (jar, xml) {
38
+ try {
39
+ const j = jar
40
+ ? normalise(jar)
41
+ : jar
42
+
43
+ const x = xml
44
+ ? normalise(xml)
45
+ : xml
46
+
47
+ return await transformToJS(j, x)
48
+ } catch ({ message }) {
49
+ error(message)
50
+ }
51
+ }
52
+
53
+ export async function toES (jar, xml) {
54
+ try {
55
+ const j = jar
56
+ ? normalise(jar)
57
+ : jar
58
+
59
+ const x = xml
60
+ ? normalise(xml)
61
+ : xml
62
+
63
+ return await transformToES(j, x)
64
+ } catch ({ message }) {
65
+ error(message)
66
+ }
67
+ }
@@ -1,65 +1,65 @@
1
- import debug from 'debug'
2
-
3
- import * as musicLibraryParser from '@sequencemedia/music-library-parser'
4
-
5
- import normalise from '#music-library/common/normalise'
6
-
7
- const {
8
- library: {
9
- transform: {
10
- toJSON: transformToJSON,
11
- toJS: transformToJS,
12
- toES: transformToES
13
- }
14
- }
15
- } = musicLibraryParser
16
-
17
- const error = debug('@sequencemedia/music-library:transform:error')
18
-
19
- export async function toJSON (jar, xml) {
20
- try {
21
- const j = jar
22
- ? normalise(jar)
23
- : jar
24
-
25
- const x = xml
26
- ? normalise(xml)
27
- : xml
28
-
29
- return await transformToJSON(j, x)
30
- } catch ({ message }) {
31
- error(message)
32
- }
33
- }
34
-
35
- export async function toJS (jar, xml) {
36
- try {
37
- const j = jar
38
- ? normalise(jar)
39
- : jar
40
-
41
- const x = xml
42
- ? normalise(xml)
43
- : xml
44
-
45
- return await transformToJS(j, x)
46
- } catch ({ message }) {
47
- error(message)
48
- }
49
- }
50
-
51
- export async function toES (jar, xml) {
52
- try {
53
- const j = jar
54
- ? normalise(jar)
55
- : jar
56
-
57
- const x = xml
58
- ? normalise(xml)
59
- : xml
60
-
61
- return await transformToES(j, x)
62
- } catch ({ message }) {
63
- error(message)
64
- }
65
- }
1
+ import debug from 'debug'
2
+
3
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
4
+
5
+ import normalise from '#music-library/common/normalise'
6
+
7
+ const {
8
+ library: {
9
+ transform: {
10
+ toJSON: transformToJSON,
11
+ toJS: transformToJS,
12
+ toES: transformToES
13
+ }
14
+ }
15
+ } = musicLibraryParser
16
+
17
+ const error = debug('@sequencemedia/music-library:transform:error')
18
+
19
+ export async function toJSON (jar, xml) {
20
+ try {
21
+ const j = jar
22
+ ? normalise(jar)
23
+ : jar
24
+
25
+ const x = xml
26
+ ? normalise(xml)
27
+ : xml
28
+
29
+ return await transformToJSON(j, x)
30
+ } catch ({ message }) {
31
+ error(message)
32
+ }
33
+ }
34
+
35
+ export async function toJS (jar, xml) {
36
+ try {
37
+ const j = jar
38
+ ? normalise(jar)
39
+ : jar
40
+
41
+ const x = xml
42
+ ? normalise(xml)
43
+ : xml
44
+
45
+ return await transformToJS(j, x)
46
+ } catch ({ message }) {
47
+ error(message)
48
+ }
49
+ }
50
+
51
+ export async function toES (jar, xml) {
52
+ try {
53
+ const j = jar
54
+ ? normalise(jar)
55
+ : jar
56
+
57
+ const x = xml
58
+ ? normalise(xml)
59
+ : xml
60
+
61
+ return await transformToES(j, x)
62
+ } catch ({ message }) {
63
+ error(message)
64
+ }
65
+ }
@@ -1 +1 @@
1
- export * as library from '#music-library/watch/library'
1
+ export * as library from '#music-library/watch/library'
@@ -1,42 +1,42 @@
1
- import chokidar from 'chokidar'
2
-
3
- import debug from 'debug'
4
-
5
- import musicLibraryParser from '@sequencemedia/music-library-parser'
6
-
7
- import normalise from '#music-library/common/normalise'
8
-
9
- const {
10
- library: {
11
- toM3U: parseToM3U
12
- }
13
- } = musicLibraryParser
14
-
15
- const error = debug('@sequencemedia/music-library:error')
16
-
17
- export function toM3U (jar, xml, destination) {
18
- const j = jar
19
- ? normalise(jar)
20
- : jar
21
-
22
- const x = xml
23
- ? normalise(xml)
24
- : xml
25
-
26
- const d = destination
27
- ? normalise(destination)
28
- : destination
29
-
30
- return (
31
- chokidar.watch(x)
32
- .on('ready', () => parseToM3U(j, x, d))
33
- .on('change', () => parseToM3U(j, x, d))
34
- .on('error', ({ message }) => {
35
- error(`Error in watcher: "${message}"`)
36
- })
37
- )
38
- }
39
-
40
- export * as tracks from '#music-library/watch/library/tracks'
41
- export * as playlists from '#music-library/watch/library/playlists'
42
- export * as transform from '#music-library/watch/library/transform'
1
+ import chokidar from 'chokidar'
2
+
3
+ import debug from 'debug'
4
+
5
+ import musicLibraryParser from '@sequencemedia/music-library-parser'
6
+
7
+ import normalise from '#music-library/common/normalise'
8
+
9
+ const {
10
+ library: {
11
+ toM3U: parseToM3U
12
+ }
13
+ } = musicLibraryParser
14
+
15
+ const error = debug('@sequencemedia/music-library:error')
16
+
17
+ export function toM3U (jar, xml, destination) {
18
+ const j = jar
19
+ ? normalise(jar)
20
+ : jar
21
+
22
+ const x = xml
23
+ ? normalise(xml)
24
+ : xml
25
+
26
+ const d = destination
27
+ ? normalise(destination)
28
+ : destination
29
+
30
+ return (
31
+ chokidar.watch(x)
32
+ .on('ready', () => parseToM3U(j, x, d))
33
+ .on('change', () => parseToM3U(j, x, d))
34
+ .on('error', ({ message }) => {
35
+ error(`Error in watcher: "${message}"`)
36
+ })
37
+ )
38
+ }
39
+
40
+ export * as tracks from '#music-library/watch/library/tracks'
41
+ export * as playlists from '#music-library/watch/library/playlists'
42
+ export * as transform from '#music-library/watch/library/transform'