210 lines
No EOL
4.3 KiB
TypeScript
210 lines
No EOL
4.3 KiB
TypeScript
|
|
export interface SmartBlockCriteria {
|
|
criteria: string;
|
|
modifier: string;
|
|
value: string | number; // Può essere stringa o numero, a seconda del valore
|
|
extra?: string; // Opzionale, se presente
|
|
criteriagroup?: number;
|
|
block_id?: number; // Identificatore del blocco associato
|
|
}
|
|
|
|
export const baseSmartBlockCriteria = (): SmartBlockCriteria => {
|
|
return {
|
|
criteria: '',
|
|
modifier: '',
|
|
value: '',
|
|
extra: '',
|
|
criteriagroup: null,
|
|
block_id: 0
|
|
}
|
|
}
|
|
|
|
export const genericSmartBlockCriteriaList = [
|
|
{
|
|
type: 'string',
|
|
title: 'Nome dell\'Album',
|
|
value: 'album_title'
|
|
},
|
|
{
|
|
type: 'string',
|
|
title: 'Nome dell\'Artista',
|
|
value: 'artist_name'
|
|
},
|
|
{
|
|
type: 'number',
|
|
title: 'Bit Rate (kbps)',
|
|
value: 'bit_rate'
|
|
},
|
|
{
|
|
type: 'number',
|
|
title: 'BPM',
|
|
value: 'bpm'
|
|
},
|
|
{
|
|
type: 'string',
|
|
title: 'Genere',
|
|
value: 'genre'
|
|
},
|
|
{
|
|
type: 'TrackType',
|
|
title: 'Tipo di traccia',
|
|
value: 'track_type_id'
|
|
}
|
|
|
|
]
|
|
|
|
export const genericSmartBlockCriteriaModifiersList = [
|
|
{
|
|
value: 'contains',
|
|
title: 'contiene',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'does not contain',
|
|
title: 'non contiene',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'starts with',
|
|
title: 'comincia con',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'ends with',
|
|
title: 'finisce con',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'is greater than',
|
|
title: 'è maggiore di',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is less than',
|
|
title: 'è minore di',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is in the range',
|
|
title: 'è tra',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is',
|
|
title: 'è uguale a',
|
|
type: 'all'
|
|
},
|
|
{
|
|
value: 'is not',
|
|
title: 'è diverso da',
|
|
type: 'all'
|
|
},
|
|
]
|
|
|
|
export const smartBlockCriteriaSortList = [
|
|
{
|
|
title: 'Random',
|
|
value: 'random'
|
|
},
|
|
{
|
|
title: 'Dal più recente',
|
|
value: 'newest'
|
|
},
|
|
{
|
|
title: 'Dal meno recente',
|
|
value: 'oldest'
|
|
},
|
|
{
|
|
title: 'Più recentemente andate in onda',
|
|
value: 'mostrecentplay'
|
|
},
|
|
{
|
|
title: 'Meno recentemente andate in onda',
|
|
value: 'leastrecentplay'
|
|
}
|
|
]
|
|
|
|
export function smartblockCriteria() {
|
|
const criteria = [ {
|
|
type: 'string',
|
|
title: 'Nome dell\'Album',
|
|
value: 'album_title'
|
|
},
|
|
{
|
|
type: 'string',
|
|
title: 'Nome dell\'Artista',
|
|
value: 'artist_name'
|
|
},
|
|
{
|
|
type: 'number',
|
|
title: 'Bit Rate (kbps)',
|
|
value: 'bit_rate'
|
|
},
|
|
{
|
|
type: 'number',
|
|
title: 'BPM',
|
|
value: 'bpm'
|
|
},
|
|
{
|
|
type: 'string',
|
|
title: 'Genere',
|
|
value: 'genre'
|
|
},
|
|
{
|
|
type: 'TrackType',
|
|
title: 'Tipo di traccia',
|
|
value: 'track_type_id'
|
|
}
|
|
|
|
]
|
|
|
|
const modifiers = [
|
|
{
|
|
value: 'contains',
|
|
title: 'contiene',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'does not contain',
|
|
title: 'non contiene',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'starts with',
|
|
title: 'comincia con',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'ends with',
|
|
title: 'finisce con',
|
|
type: 'string'
|
|
},
|
|
{
|
|
value: 'is greater than',
|
|
title: 'è maggiore di',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is less than',
|
|
title: 'è minore di',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is in the range',
|
|
title: 'è tra',
|
|
type: 'number'
|
|
},
|
|
{
|
|
value: 'is',
|
|
title: 'è uguale a',
|
|
type: 'all'
|
|
},
|
|
{
|
|
value: 'is not',
|
|
title: 'è diverso da',
|
|
type: 'all'
|
|
},
|
|
]
|
|
|
|
return { criteria, modifiers }
|
|
} |