"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.SubsonicCache = void 0;
const SubsonicCache = {
  // searchArtistNames: function(s) {
  //   s = s || "";
  //   s = s.trim();
  //   if (s.length === 0) return [];
  //   s = s.toUpperCase();
  //   var a = $.grep(this.ArtistNames, function(o, i) {
  //     return o.toUpperCase().indexOf(s) > -1;
  //   });
  //   return a || [];
  // },
  MusicFolders: [],
  // map of id to indexes as string of the number, cached as you go, -1 for all
  MusicDirectoryIndexes: {},
  MusicPaths: {},
  // full path for id
  // map of id to indexes as string of the number, cached as you go, -1 for all
  ArtistIndexes: {},
  ArtistsById: {},
  ArtistsByName: {},
  ArtistNames: [],
  Albums: {},
  // fetch on demand at the view layer but still cache
  ArtistInfoById: {},
  AlbumInfoById: {},
  Playlists: [],
  NormalPlaylists: [],
  Stations: [],
  Genres: [],
  reset: function () {
    console.error('reset!'); // just an array of them, unsorted (view can sort)

    this.MusicFolders = []; // map of id to indexes as string of the number, cached as you go, -1 for all

    this.MusicDirectoryIndexes = {};
    this.MusicPaths = {}; // full path for id
    // map of id to indexes as string of the number, cached as you go, -1 for all

    this.ArtistIndexes = {};
    this.ArtistsById = {};
    this.ArtistsByName = {};
    this.ArtistNames = [];
    this.Albums = {}; // fetch on demand at the view layer but still cache

    this.ArtistInfoById = {};
    this.AlbumInfoById = {}; // only used for radio and other things to get the names. use context for everything else.

    this.Playlists = [];
    this.Genres = [];
  }
};
exports.SubsonicCache = SubsonicCache;
window.cache = SubsonicCache;
var _default = SubsonicCache;
exports.default = _default;