Skip to content

Commit 41f7229

Browse files
committed
Fix Traxsource cover, add release date to manual tag
1 parent 852512d commit 41f7229

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

client/src/components/ManualTag.vue

+23-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<div class='q-pr-sm'>
3030
<q-checkbox
3131
:model-value="selected.includes(match)"
32-
@update:model-value="(v) => toggleMatch(match)"
32+
@update:model-value="(v: any) => toggleMatch(match)"
3333
></q-checkbox>
3434
</div>
3535
<!-- Open URL -->
@@ -58,12 +58,29 @@
5858
<span class='q-px-sm' :class='accuracyColor(match.accuracy)'><span class='text-subtitle3'>{{ (match.accuracy * 100.0).toFixed(2) }}%</span></span>
5959
<span v-if='match.reason != "fuzzy"'>{{ match.reason.toUpperCase() }}</span>
6060
</q-item-label>
61-
<q-item-label class='title-span text-grey-6 text-weight-medium'>{{ match.track.artists.join(", ") }}  <span class='text-grey-4 text-weight-medium'> {{ match.track.title }}</span><span class='text-grey-4' v-if='match.track.version'> ({{ match.track.version }})</span></q-item-label>
62-
<q-item-label class='text-grey-6' v-if='match.track.album'><q-badge outline color='grey-9'><span class='text-uppercase text-grey-6'>Album</span></q-badge>  <span class='text-caption text-weight-medium text-grey-5'>{{ match.track.album }}</span></q-item-label>
61+
<q-item-label class='title-span text-grey-6 text-weight-medium'>{{ match.track.artists.join(", ") }}
62+
<span class='text-grey-4 text-weight-medium'> {{ match.track.title }}</span>
63+
<span class='text-grey-4' v-if='match.track.version'> ({{ match.track.version }})</span>
64+
</q-item-label>
65+
<q-item-label class='text-grey-6' v-if='match.track.album'><q-badge outline color='grey-9'><span class='text-uppercase text-grey-6'>Album</span></q-badge> <span class='text-caption text-weight-medium text-grey-5'>{{ match.track.album }}</span></q-item-label>
6366
<q-item-label class='text-grey-6'>
64-
<span v-if='match.track.genres.length > 0'><q-badge outline color='grey-9'><span class='text-uppercase text-grey-6'>Genre</span></q-badge>  <span class='text-caption text-weight-bold text-grey-4'>{{ match.track.genres.join(", ") }}</span></span>
65-
<span v-if='match.track.bpm'>  <q-badge outline color='grey-9'><span class='text-uppercase text-grey-6'>BPM</span></q-badge>  <span class='text-caption monospace text-weight-medium text-grey-4'>{{ match.track.bpm }}</span></span>
66-
<span v-if='match.track.key'>  <q-badge outline color='grey-9'><span class='text-uppercase text-grey-6'>Key</span></q-badge>  <span class='text-caption monospace text-weight-medium' :style='keyColor(match.track.key)'>{{ match.track.key }}</span></span>
67+
<span v-if='match.track.genres.length > 0'>
68+
<q-badge outline color='grey-9' class='q-mr-xs'><span class='text-uppercase text-grey-6'>Genre</span></q-badge>
69+
<span class='text-caption text-weight-bold text-grey-4'>{{ match.track.genres.join(", ") }}</span>
70+
</span>
71+
<span v-if='match.track.bpm'>
72+
<q-badge outline color='grey-9' class='q-mx-xs'><span class='text-uppercase text-grey-6'>BPM</span></q-badge>
73+
<span class='text-caption monospace text-weight-medium text-grey-4'>{{ match.track.bpm }}</span>
74+
</span>
75+
<span v-if='match.track.key'>
76+
<q-badge outline color='grey-9' class='q-mx-xs'><span class='text-uppercase text-grey-6'>Key</span></q-badge>
77+
<span class='text-caption monospace text-weight-medium' :style='keyColor(match.track.key)'>{{ match.track.key }}</span>
78+
</span>
79+
<br>
80+
<span v-if='match.track.release_date'>
81+
<q-badge outline color='grey-9' class='q-mr-xs'><span class='text-uppercase text-grey-6'>Release Date</span></q-badge>
82+
<span class='text-caption monospace text-weight-medium text-grey-4'>{{ match.track.release_date }}</span>
83+
</span>
6784
</q-item-label>
6885
</q-item-section>
6986
</q-item>

crates/onetagger-platforms/src/traxsource.rs

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ impl Traxsource {
9696
let release_date_clean = release_date_raw.replace("Pre-order for ", "");
9797
let release_date = release_date_clean.trim().to_owned();
9898

99+
// Art
100+
selector = Selector::parse("div.thumb img").unwrap();
101+
let art_url = track_element.select(&selector).next().unwrap().attr("src").map(String::from);
102+
99103
// Create track
100104
tracks.push(Track {
101105
platform: "traxsource".to_string(),
@@ -107,6 +111,7 @@ impl Traxsource {
107111
track_id: Some(track_id),
108112
release_id: String::new(),
109113
duration: duration.into(),
114+
thumbnail: art_url,
110115
..Default::default()
111116
})
112117
}

crates/onetagger-ui/src/socket.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,10 @@ async fn handle_message(text: &str, websocket: &mut WebSocket, context: &mut Soc
585585
info!("Manual tag starting for path: {path:?}");
586586
TaggerConfigs::AutoTagger(config.clone()).debug_print();
587587

588-
let rx = onetagger_autotag::manual_tagger(path, &config)?;
588+
let rx = tokio::task::spawn_blocking(move || {
589+
onetagger_autotag::manual_tagger(path, &config)
590+
}).await.unwrap()?;
591+
589592
for (platform, r) in rx {
590593
match r {
591594
Ok(matches) => {

0 commit comments

Comments
 (0)