Skip to content

Commit

Permalink
Added raw song text to songs table
Browse files Browse the repository at this point in the history
  • Loading branch information
warmans committed Oct 6, 2024
1 parent bbffcab commit 7bc4afe
Show file tree
Hide file tree
Showing 12 changed files with 2,314 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<th>Song Title</th>
<th>Artist</th>
<th>Episodes</th>
<th>Transcription</th>
</tr>
<tr *ngFor="let song of songs">
<td>
Expand All @@ -38,6 +39,12 @@
*ngFor="let epid of song.episodeIds"
[routerLink]="['/ep', 'ep-'+epid]">{{epid}}</a>
</td>
<td>
<span
class="text-muted text-sm mr-2 transcript pl-2 mb-1"
*ngFor="let text of song.transcribed"
>{{text}}</span>
</td>
</tr>
</table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
.missing-album-image {
border: 1px dashed;
}

.transcript {
border-left: 2px solid;
padding-left: 5px;
display: block;
}
}
}
6 changes: 6 additions & 0 deletions gui/src/assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2930,6 +2930,12 @@
},
"albumImageUrl": {
"type": "string"
},
"transcribed": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down
10 changes: 7 additions & 3 deletions server/cmd/data/spotifize.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ func addSongMeta(logger *zap.Logger, token string, metadataPath string, forceCac
}
} else {
songCache.Songs[track.TrackURI] = &meta.Song{
Terms: []string{searchTerm},
EpisodeIDs: []string{shortId},
Track: track,
Transcribed: []string{v.Content},
Terms: []string{searchTerm},
EpisodeIDs: []string{shortId},
Track: track,
}
}
} else {
Expand All @@ -204,6 +205,9 @@ func addSongMeta(logger *zap.Logger, token string, metadataPath string, forceCac
if slices.Index(songCache.Songs[cachedId].Terms, searchTerm) == -1 {
songCache.Songs[cachedId].Terms = append(songCache.Songs[cachedId].Terms, searchTerm)
}
if slices.Index(songCache.Songs[cachedId].Transcribed, v.Content) == -1 {
songCache.Songs[cachedId].Transcribed = append(songCache.Songs[cachedId].Transcribed, v.Content)
}
}

ep.Transcript[k].Meta = models.Metadata{}
Expand Down
6 changes: 6 additions & 0 deletions server/gen/api/open-api/search.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,12 @@
},
"albumImageUrl": {
"type": "string"
},
"transcribed": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down
170 changes: 90 additions & 80 deletions server/gen/api/search.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit 7bc4afe

Please sign in to comment.