Skip to content

Commit

Permalink
Deezer content language
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Aug 29, 2024
1 parent 5508ad0 commit e8d9fbb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/components/PlayerBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
:min="0.0"
:max="1.0"
:step="0.01"
@update:model-value="(v: number) => $1t.player.value.setVolume(v)"
@update:model-value="(v: any) => $1t.player.value.setVolume(v)"
@change="$1t.saveSettings(false)"
style="margin-top: 6px"
></q-slider>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/QuickTagFileBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<div class='q-my-sm' v-if='editPath'>
<form @submit.prevent='loadFiles()'>
<q-input outlined dense v-model='path'></q-input>
<q-input outlined dense v-model='path' @blur='editPath = false'></q-input>
</form>
</div>

Expand Down
16 changes: 13 additions & 3 deletions crates/onetagger-platforms/src/deezer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::Error;
use reqwest::header::{HeaderMap, HeaderValue};
use std::time::Duration;
use chrono::NaiveDate;
use onetagger_tagger::{Track, AutotaggerSourceBuilder, PlatformInfo, TaggerConfig, AutotaggerSource, PlatformCustomOptions, PlatformCustomOptionValue, AudioFileInfo, MatchingUtils, TrackNumber, supported_tags, TrackMatch};
Expand All @@ -17,8 +18,15 @@ struct Deezer {
impl Deezer {
/// Create new instance
pub fn new(config: DeezerConfig) -> Deezer {
let mut headers = HeaderMap::new();
headers.append("Content-Language", HeaderValue::from_str(&config.content_language).unwrap());
headers.append("Accept-Language", HeaderValue::from_str(&config.content_language).unwrap());

Deezer {
client: Client::new(),
client: Client::builder()
.default_headers(headers)
.build()
.unwrap(),
config
}
}
Expand Down Expand Up @@ -286,13 +294,15 @@ impl AutotaggerSourceBuilder for DeezerBuilder {
requires_auth: false,
supported_tags: supported_tags!(Title, Version, Album, AlbumArtist, Artist, AlbumArt, URL, CatalogNumber, TrackId, ReleaseId, Duration, Genre, TrackTotal, Label, ISRC, ReleaseDate, TrackNumber, DiscNumber, Explicit, BPM),
custom_options: PlatformCustomOptions::new()
.add("art_resolution", "Album Art Resolution", PlatformCustomOptionValue::Number { min: 100, max: 1600, step: 100, value: 1200 }),
.add("art_resolution", "Album Art Resolution", PlatformCustomOptionValue::Number { min: 100, max: 1600, step: 100, value: 1200 })
.add_tooltip("content_language", "Content Language", "Enter a locale to use with Deezer API", PlatformCustomOptionValue::String { value: "en-US".to_string(), hidden: Some(false) })
}
}
}


#[derive(Debug, Clone, Serialize, Deserialize)]
struct DeezerConfig {
pub art_resolution: u16
pub art_resolution: u16,
pub content_language: String
}

0 comments on commit e8d9fbb

Please sign in to comment.