alphatheta-connect 0.23.1 → 0.25.0

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,8 +1,10 @@
1
1
  /**
2
2
  * The default virtual CDJ ID to use.
3
3
  *
4
- * This particular ID is out of the 1-6 range, thus will not be able to request
5
- * metadata via the remotedb for CDJs.
4
+ * Out of the 1-6 player range, so it can never collide with a real CDJ.
5
+ * Remotedb metadata still works from here: the 1-6 restriction applies to the
6
+ * device-ID byte inside remotedb messages, which RemoteDatabase picks
7
+ * per-connection independently of the announced ID.
6
8
  */
7
9
  export declare const DEFAULT_VCDJ_ID = 7;
8
10
  /**
@@ -25,5 +25,27 @@ export interface Options {
25
25
  */
26
26
  span?: Span;
27
27
  }
28
+ /**
29
+ * Why a local database lookup produced no track.
30
+ *
31
+ * `viaLocal` used to answer both cases with a bare `null`, so a metadata
32
+ * failure in the field was indistinguishable from a slot that never hydrated
33
+ * — the reason NP3-361 could not be diagnosed from the logs a user sent in.
34
+ */
35
+ export type LocalMiss =
36
+ /** No rekordbox database is loaded for that device slot */
37
+ 'no-database'
38
+ /** The database is loaded, but holds no track with that id */
39
+ | 'track-absent';
40
+ /**
41
+ * The outcome of a local database metadata lookup.
42
+ */
43
+ export type LocalResult = {
44
+ track: Track;
45
+ miss: null;
46
+ } | {
47
+ track: null;
48
+ miss: LocalMiss;
49
+ };
28
50
  export declare function viaRemote(remote: RemoteDatabase, opts: Required<Options>): Promise<Track<import("../entities").EntityFK.WithRelations> | null>;
29
- export declare function viaLocal(local: LocalDatabase, device: Device, opts: Required<Options>): Promise<Track | null>;
51
+ export declare function viaLocal(local: LocalDatabase, device: Device, opts: Required<Options>): Promise<LocalResult>;
package/lib/db/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import DeviceManager from "../devices";
2
2
  import { Track } from "../entities";
3
3
  import LocalDatabase from "../localdb";
4
4
  import { DatabaseType } from "../localdb/database-adapter";
5
+ import { type Logger } from "../logger";
5
6
  import RemoteDatabase from "../remotedb";
6
7
  import { MediaSlot, PlaylistContents, Waveforms } from "../types";
7
8
  import * as GetArtworkFromFile from './getArtworkFromFile';
@@ -15,7 +16,7 @@ import * as GetTrackAnalysis from './getTrackAnalysis';
15
16
  */
16
17
  declare class Database {
17
18
  #private;
18
- constructor(local: LocalDatabase, remote: RemoteDatabase, deviceManager: DeviceManager);
19
+ constructor(local: LocalDatabase, remote: RemoteDatabase, deviceManager: DeviceManager, logger?: Logger);
19
20
  /**
20
21
  * Get the database type (oneLibrary or pdb) for a loaded device slot.
21
22
  * Returns null if the slot uses remote database or no database is loaded.
package/lib/index.d.ts CHANGED
@@ -13,8 +13,8 @@ export { fetchFile } from './nfs';
13
13
  export type { DatabaseAdapter, DatabasePreference, DatabaseType, PlaylistQueryResult, } from 'onelibrary-connect';
14
14
  export { OneLibraryAdapter } from 'onelibrary-connect';
15
15
  export type { Category, DeviceProperty, HistorySession, HotCueBankList, MenuItem, MyTag, SortOption, } from 'onelibrary-connect';
16
- export type { DeviceLike, PickDeviceIdOptions } from './virtualcdj/device-id';
17
- export { DEFAULT_MIXER_PLAYER_CEILING, MAX_DEVICE_ID, MIXER_PLAYER_CEILING, pickAvailableDeviceId, playerNumberCeiling, REMOTEDB_MAX_DEVICE_ID, } from './virtualcdj/device-id';
16
+ export type { DeviceLike, PickDeviceIdOptions, QueryIdDeviceLike, } from './virtualcdj/device-id';
17
+ export { DEFAULT_MIXER_PLAYER_CEILING, MAX_DEVICE_ID, MIXER_PLAYER_CEILING, pickAvailableDeviceId, pickRemoteDbQueryId, playerNumberCeiling, REMOTEDB_MAX_DEVICE_ID, } from './virtualcdj/device-id';
18
18
  export type { Logger } from './logger';
19
19
  export { noopLogger } from './logger';
20
20
  export * from './types';