mixxx-smart-crates 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -98,7 +98,7 @@ Example:
98
98
  !(location ? Recordings) & (
99
99
  genre ? "Tech House",
100
100
  bpm >= 126, bpm <= 132
101
- $cues > 0,
101
+ $hotcues > 0,
102
102
  $playlists = 0,
103
103
  )
104
104
  ```
@@ -276,6 +276,6 @@ Propeties map directly to mixxx db model, table [`library`](https://github.com/m
276
276
 
277
277
  It also provides this custom properties:
278
278
 
279
- - `$cues`: number of memory cues set on a track
279
+ - `$hotcues`: number of memory cues set on a track
280
280
  - `$playlists`: number of playlists featuring a track
281
281
  - `$age`: how old is the track in year (if `year` field is filled)
package/TODO.txt ADDED
@@ -0,0 +1 @@
1
+ 1. includere loop cue nel conteggio
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixxx-smart-crates",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "automatically populate mixxx crates by quering the library",
5
5
  "keywords": [
6
6
  "mixxx",
package/src/args.js CHANGED
@@ -61,7 +61,7 @@ OPTIONS:
61
61
  QUERY:
62
62
  Example:
63
63
 
64
- $playlists == 0, $cues > 0, (
64
+ $playlists == 0, $hotcues > 0, (
65
65
  genre ? house, rating == 5;
66
66
  genre ? ukg, rating >= 4;
67
67
  ), !(
@@ -101,7 +101,7 @@ QUERY:
101
101
  <= Less than or equal
102
102
 
103
103
  Extra tags/properties:
104
- $cues Number of cue points set on the track
104
+ $hotcues Number of cue points set on the track
105
105
  $playlists Number of playlists featuring the track
106
106
 
107
107
  DIRECTORY MODE:
package/src/db.js CHANGED
@@ -45,7 +45,7 @@ async function fetchTracks(db) {
45
45
  const cueCounts = await db.allAsync(`
46
46
  SELECT track_id, COUNT(*) as cueCount
47
47
  FROM cues
48
- WHERE (hotcue != -1) AND position >= 0
48
+ WHERE hotcue != -1 and type in (1, 4)
49
49
  GROUP BY track_id
50
50
  `);
51
51
 
@@ -70,7 +70,7 @@ async function fetchTracks(db) {
70
70
 
71
71
  const nowYear = parseInt(new Date().getFullYear());
72
72
  for (const track of tracks) {
73
- track.$cues = cuesByTrack[track.id] || 0;
73
+ track.$hotcues = cuesByTrack[track.id] || 0;
74
74
  track.$playlists = playlistCountMap[track.id] || 0;
75
75
 
76
76
  const trackYear = parseInt(track.year);
package/src/db.test.js CHANGED
@@ -57,13 +57,13 @@ describe("DB module", () => {
57
57
  const result = await fetchTracks(db);
58
58
 
59
59
  expect(result).toEqual([
60
- { id: 1, artist: "A", title: "T", $cues: 3, $playlists: 0, $age: 0 },
60
+ { id: 1, artist: "A", title: "T", $hotcues: 3, $playlists: 0, $age: 0 },
61
61
  {
62
62
  id: 2,
63
63
  artist: "B",
64
64
  title: "U",
65
65
  year: 2020,
66
- $cues: 0,
66
+ $hotcues: 0,
67
67
  $playlists: 5,
68
68
  $age: 6,
69
69
  },
package/src/index.js CHANGED
@@ -12,7 +12,7 @@ const { parseArgv, HELP } = require("./args");
12
12
  function reprTrack(track, debug = false) {
13
13
  if (debug) return JSON.stringify(track);
14
14
  const bpm = (track.bpm < 100 ? " " : "") + track.bpm.toFixed(2);
15
- return `[${bpm} ${track.key}] ${track.artist} - ${track.title} [cues: ${track.$cues}, playlists: ${track.$playlists}]`;
15
+ return `[${bpm} ${track.key}] ${track.artist} - ${track.title} [cues: ${track.$hotcues}, playlists: ${track.$playlists}]`;
16
16
  }
17
17
 
18
18
  function reprTrackList(tracks, debug = false) {
package/src/index.test.js CHANGED
@@ -27,7 +27,7 @@ const tracks = [
27
27
  key: "1A",
28
28
  artist: "Artist",
29
29
  title: "Track1",
30
- $cues: 2,
30
+ $hotcues: 2,
31
31
  $playlists: 0,
32
32
  },
33
33
  {
@@ -35,7 +35,7 @@ const tracks = [
35
35
  key: "1B",
36
36
  artist: "Artist",
37
37
  title: "Track2",
38
- $cues: 0,
38
+ $hotcues: 0,
39
39
  $playlists: 2,
40
40
  },
41
41
  ];