From 5b7bc6234db8a86924357e23e5e569d71940e7ed Mon Sep 17 00:00:00 2001 From: Evan Louie Date: Mon, 15 Oct 2018 22:45:27 -0700 Subject: [PATCH] filenames are now shown in classification->label table --- src/components/ClassificationTable.tsx | 5 ++++- src/components/LabelTable.tsx | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ClassificationTable.tsx b/src/components/ClassificationTable.tsx index 57e4210..edacf53 100644 --- a/src/components/ClassificationTable.tsx +++ b/src/components/ClassificationTable.tsx @@ -167,7 +167,10 @@ class LabelTableModal extends React.PureComponent<{ public async componentDidMount() { const { classification } = this.props - const labels = await Label.find({ classification }) + const labels = await Label.getRepository().find({ + where: { classification }, + relations: ["audioFile"], + }) this.setState({ labels: List(labels) }) } diff --git a/src/components/LabelTable.tsx b/src/components/LabelTable.tsx index 09e5340..9f011ac 100644 --- a/src/components/LabelTable.tsx +++ b/src/components/LabelTable.tsx @@ -15,6 +15,7 @@ import { } from "@material-ui/core" import { Delete, PlayArrow } from "@material-ui/icons" import { List, Set } from "immutable" +import path from "path" import React, { StatelessComponent } from "react" import { Classification } from "../entities/Classification" import { Label } from "../entities/Label" @@ -79,6 +80,7 @@ export class LabelTable extends React.PureComponent { Classifier + File Start (Seconds) End (Seconds) @@ -103,8 +105,9 @@ export class LabelTable extends React.PureComponent { label, isPlaying = false, }) => { - const { startTime, endTime } = label + const { startTime, endTime, audioFile } = label const { classifications } = this.state + return ( @@ -115,6 +118,7 @@ export class LabelTable extends React.PureComponent { /> + {path.join(audioFile.dirname, audioFile.basename)} {startTime} {endTime}