Skip to content

Instantly share code, notes, and snippets.

@mill1000
mill1000 / audio_custom.js
Last active May 10, 2023 04:00
Custom Gerbera Import Scripts
// Helper to access first element of an array if it exists
function get(item, fallback) {
return (item && item[0]) || fallback;
}
// Custom audio import script
function addAudioCustom(obj) {
var title = get(obj.metaData[M_TITLE], obj.title);
var artist = get(obj.metaData[M_ARTIST], "Unknown");
var album = get(obj.metaData[M_ALBUM], "Unknown");