Skip to content

Commit

Permalink
filenames are now shown in classification->label table
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlouie committed Oct 16, 2018
1 parent 6eb78da commit 5b7bc62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/ClassificationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
}

Expand Down
6 changes: 5 additions & 1 deletion src/components/LabelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -79,6 +80,7 @@ export class LabelTable extends React.PureComponent<ILabelTableProps> {
<TableHead>
<TableRow>
<TableCell>Classifier</TableCell>
<TableCell>File</TableCell>
<TableCell>Start (Seconds)</TableCell>
<TableCell>End (Seconds)</TableCell>
<TableCell />
Expand All @@ -103,8 +105,9 @@ export class LabelTable extends React.PureComponent<ILabelTableProps> {
label,
isPlaying = false,
}) => {
const { startTime, endTime } = label
const { startTime, endTime, audioFile } = label
const { classifications } = this.state

return (
<TableRow selected={isPlaying}>
<TableCell>
Expand All @@ -115,6 +118,7 @@ export class LabelTable extends React.PureComponent<ILabelTableProps> {
/>
</span>
</TableCell>
<TableCell>{path.join(audioFile.dirname, audioFile.basename)}</TableCell>
<TableCell>{startTime}</TableCell>
<TableCell>{endTime}</TableCell>
<TableCell>
Expand Down

0 comments on commit 5b7bc62

Please sign in to comment.