@jjdenhertog/plex-music-search 1.0.21 → 1.0.23

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 (2) hide show
  1. package/index.js +9 -6
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -107,9 +107,9 @@ var PlexMusicSearch = /** @class */ (function () {
107
107
  case 0:
108
108
  _a = this._config.searchApproaches, approaches = _a === void 0 ? [
109
109
  { id: 'normal', filtered: false, trim: false },
110
- { id: 'filtered', filtered: true, trim: false },
110
+ { id: 'filtered', filtered: true, trim: false, removeQuotes: true },
111
111
  { id: 'trimmed', filtered: false, trim: true },
112
- { id: 'filtered_trimmed', filtered: true, trim: true }
112
+ { id: 'filtered_trimmed', filtered: true, trim: true, removeQuotes: true }
113
113
  ] : _a;
114
114
  musicSearch = music_search_1.default.getInstance();
115
115
  musicSearch.config = this._config;
@@ -139,10 +139,12 @@ var PlexMusicSearch = /** @class */ (function () {
139
139
  return __generator(this, function (_b) {
140
140
  _a = this._config.searchApproaches, approaches = _a === void 0 ? [
141
141
  { id: 'normal', filtered: false, trim: false },
142
- { id: 'filtered', filtered: true, trim: false },
142
+ { id: 'filtered', filtered: true, trim: false, removeQuotes: true },
143
143
  { id: 'trimmed', filtered: false, trim: true },
144
- { id: 'filtered_trimmed', filtered: true, trim: true }
144
+ { id: 'filtered_trimmed', filtered: true, trim: true, removeQuotes: true }
145
145
  ] : _a;
146
+ // Reset cache
147
+ this._cache = [];
146
148
  musicSearch = music_search_1.default.getInstance();
147
149
  musicSearch.config = this._config;
148
150
  return [2 /*return*/, this._newTrackSearch(approaches, track, true)];
@@ -319,7 +321,7 @@ var PlexMusicSearch = /** @class */ (function () {
319
321
  args_1[_i - 4] = arguments[_i];
320
322
  }
321
323
  return __awaiter(_this, __spreadArray([approach_1, artist_1, title_1, album_2], args_1, true), void 0, function (approach, artist, title, album, searchAlbumTracks) {
322
- var cacheId, foundCache, searchHandler, searchResults, musicSearchResult, plexTracks;
324
+ var cacheId, foundCache, searchHandler, searchResults, musicSearchResult, plexTracks, approachId;
323
325
  if (searchAlbumTracks === void 0) { searchAlbumTracks = false; }
324
326
  return __generator(this, function (_a) {
325
327
  switch (_a.label) {
@@ -343,7 +345,8 @@ var PlexMusicSearch = /** @class */ (function () {
343
345
  .filter(function (item) { return !!item; })
344
346
  .map(function (item) { return (__assign(__assign({}, (0, hubSearchToPlexTrack_1.default)(item)), { matching: item.matching, reason: item.reason })); });
345
347
  this._cache.push({ id: cacheId, result: plexTracks });
346
- queries.push({ approach: approach, artist: artist, title: title, album: album });
348
+ approachId = searchAlbumTracks ? "".concat(approach, "-album") : approach;
349
+ queries.push({ approach: approachId, artist: artist, title: title, album: album });
347
350
  return [2 /*return*/, plexTracks];
348
351
  }
349
352
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjdenhertog/plex-music-search",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Library to find tracks in your Plex Library",
5
5
  "keywords": [
6
6
  "plex",
@@ -18,7 +18,7 @@
18
18
  "npm": ">=10.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "@jjdenhertog/music-search": "^1.0.7",
21
+ "@jjdenhertog/music-search": "^1.0.10",
22
22
  "axios": "^1.4.0",
23
23
  "qs": "^6.12.0",
24
24
  "string-similarity-js": "^2.1.4"