PHP is a bad language (fixes #59 properly)

This commit is contained in:
Marks Polakovs 2020-04-11 10:44:34 +02:00
parent 7c440bb281
commit 0306667f57
3 changed files with 6 additions and 6 deletions

View file

@ -79,8 +79,8 @@ interface TimeslotItemCentral {
export interface AuxItem { export interface AuxItem {
type: "aux"; type: "aux";
summary: string; summary: string | number;
title?: string; title: string | number;
managedid: number; managedid: number;
length: string; length: string;
trackid: number; trackid: number;

View file

@ -60,7 +60,7 @@ export const Item = memo(function Item({
collect={() => ({ id })} collect={() => ({ id })}
> >
<i className={"fa fa-circle " + x.type}></i>&nbsp; <i className={"fa fa-circle " + x.type}></i>&nbsp;
{x.title} {x.title.toString()}
{"artist" in x && " - " + x.artist} {"artist" in x && " - " + x.artist}
<small <small
className={ className={

View file

@ -135,15 +135,15 @@ export function AuxLibrary({ libraryId }: { libraryId: string }) {
value={title} value={title}
onChange={e => setTitle(e.target.value)} onChange={e => setTitle(e.target.value)}
/> />
<Droppable droppableId="$CML"> <Droppable droppableId="$AUX">
{(provided, snapshot) => ( {(provided, snapshot) => (
<div ref={provided.innerRef} {...provided.droppableProps}> <div ref={provided.innerRef} {...provided.droppableProps}>
{items {items
.filter( .filter(
its => its =>
its.summary its.title.toString()
.toLowerCase() .toLowerCase()
.indexOf(its.summary.toLowerCase()) > -1 .indexOf(its.title.toString().toLowerCase()) > -1
) )
.map((item, index) => ( .map((item, index) => (
<Item <Item