JsMetadbHandle
This will be used in the examples below:
var handle = fb.GetFocusItem();
Note
In real world code, you should alaways check the return
values from methods like fb.GetFocusItem and
playback.GetNowPlaying are not null.
Properties
| FileCreated | number |
read | The number of seconds since 00:00:00 Thursday, 1 January 1970 UTC. |
| FileSize | number |
read | |
| LastModified | number |
read | The number of seconds since 00:00:00 Thursday, 1 January 1970 UTC. |
| Length | number |
read | |
| Path | string |
read | |
| RawPath | string |
read | |
| SubSong | number |
read |
Example
console.log(handle.Path); // D:\SomeSong.flac
console.log(handle.RawPath); // file://D:\SomeSong.flac
console.log(handle.FileCreated); // 1659753717
console.log(utils.TimestampToDateString(handle.FileCreated)); // 2022-08-06 03:41:57
Methods
Compare(handle)#
| Arguments | ||
|---|---|---|
| handle | JsMetadbHandle |
Returns a boolean value.
Example
if (handle.Compare(handle2)) {
// do something
}
GetAlbumArt([art_id, want_stub])#
| Arguments | ||
|---|---|---|
| art_id | AlbumArtId | Default 0. |
| want_stub | boolean |
Default true. |
Returns a JsImage instance or null on failure.
Note
This method can return album art from certain radio streams
if the requested type is Front. Use on_stream_album_art_change
to get notified of stream artwork changes.
Example
var image = handle.GetAlbumArt();
if (image != null) {
// The path is now a property of the image.
console.log(image.Path);
}
GetAlbumArtAsync([art_id])#
| Arguments | |||
|---|---|---|---|
| art_id | AlbumArtId | Default 0. |
Use in conjunction with on_get_album_art_done.
Note
This method does not retrieve stub images. See fb.GetAlbumArtStub.
GetAlbumArtEmbedded([art_id])#
| Arguments | ||
|---|---|---|
| art_id | AlbumArtId | Default 0. |
Returns a JsImage instance or null on failure.
GetAlbumArtThumbAsync([art_id, max_size])#
| Arguments | ||
|---|---|---|
| art_id | AlbumArtId | Default 0. |
| max_size | number |
Default 300. The minimum allowed value is 50. If the original image is smaller than the specified size, it will remain untouched. |
Use in conjunction with on_get_album_art_done.
Note
This method does not retrieve stub images. See fb.GetAlbumArtStub.
GetFileInfo()#
Returns a JsFileInfo instance.
IsInLibrary()#
Returns a boolean value.
ShowAlbumArtViewer([art_id, want_stub])#
| Arguments | ||
|---|---|---|
| art_id | AlbumArtId | Default 0. |
| want_stub | boolean |
Default true. |
No return value.
ShowAlbumArtViewer2(art_id, type)#
| Arguments | ||
|---|---|---|
| art_id | AlbumArtId | |
| type | AlbumArtType |
No return value.