Skip to content

Commit 90e4720

Browse files
committed
fix #52
1 parent da4cb24 commit 90e4720

File tree

10 files changed

+421
-213
lines changed

10 files changed

+421
-213
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# 0.2.1
1+
# 0.2.2
2+
* Update download url (fixes 401 errors)
3+
4+
## 0.2.1
25
* Updated 'Update Instructions'
36
* Added Docker build instructions(thanks @4c0n)
47
* Fixed typo (thanks @4c0n)

Cargo.lock

Lines changed: 403 additions & 193 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ll-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "library-loader-cli"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["Edwin Svensson <libraryloader@olback.net>"]
55
edition = "2018"
66

ll-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ crossbeam-channel = "0.3"
2929
notify = "=5.0.0-pre.1"
3030
clap = { version = "2.33", features = ["yaml"], optional = true }
3131
rpassword = { version = "4.0", optional = true }
32-
glib = { version = "0.9", optional = true }
32+
glib = { version = "0.10", optional = true }

ll-core/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Component Search Enginge Url
2-
pub const COMPONENT_SEARCH_ENGINE_URL: &str = "http://componentsearchengine.com/ga/model.php?partID=";
2+
pub const COMPONENT_SEARCH_ENGINE_URL: &str = "https://componentsearchengine.com/ga/model.php?partID=";
33

44
// Url to use to validate credentials
55
pub const TRY_AUTH_URL: &str = "https://componentsearchengine.com/ga";

ll-core/src/cse.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ impl CSE {
3737
let url = format!("{base}{id}", base = COMPONENT_SEARCH_ENGINE_URL, id = id);
3838

3939
let client = reqwest::Client::new();
40-
let req = client.get(&url).header(header::AUTHORIZATION, format!("Basic {auth}", auth = &self.auth));
40+
let req = client.get(&url)
41+
.header(header::AUTHORIZATION, format!("Basic {auth}", auth = &self.auth))
42+
.header(header::USER_AGENT, format!("Library Loader {} github.com/olback/library-loader", env!("CARGO_PKG_VERSION")));
4143
let mut res = req.send()?;
4244

4345
let res_header = match res.headers().get("content-type") {

ll-gui/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[package]
22
name = "library-loader-gui"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
authors = ["Edwin Svensson <libraryloader@olback.net>"]
55
edition = "2018"
66
build = "build/build.rs"
77

88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
gtk = "0.8"
12-
gio = "0.8"
13-
glib = "0.9"
11+
gtk = "0.9"
12+
gio = "0.9"
13+
glib = "0.10"
1414
toml = "0.5"
1515
serde = { version = "1.0", features = ["derive"] }
1616
library-loader-core = { path = "../ll-core", features = ["gui"], default-features = false }

ll-gui/src/ui/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Ui {
2121

2222
pub fn build(app: &gtk::Application, state: &AMState) -> Self {
2323

24-
let builder = gtk::Builder::new_from_string(consts::GLADE_STRING);
24+
let builder = gtk::Builder::from_string(consts::GLADE_STRING);
2525

2626
let main = main::build(&builder, &app);
2727
let notebook = notebook::Notebook::build(&builder, &main, &state);

ll-gui/src/ui/notebook/account.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,8 @@ impl Account {
7171

7272
} else {
7373

74-
let email = match email_clone.get_text() {
75-
Some(v) => v.to_string(),
76-
None => String::new()
77-
};
78-
79-
let password = match password_clone.get_text() {
80-
Some(v) => v.to_string(),
81-
None => String::new()
82-
};
74+
let email = email_clone.get_text().to_string();
75+
let password = password_clone.get_text().to_string();
8376

8477
let save_info = save_info_switch.get_active();
8578

ll-gui/src/utils/resources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::consts::RESOURCES_BYTES;
44
pub fn load_resources() {
55

66
let glib_resource_bytes = glib::Bytes::from_static(RESOURCES_BYTES);
7-
let resources = gio::Resource::new_from_data(&glib_resource_bytes).expect("Failed to load resources");
7+
let resources = gio::Resource::from_data(&glib_resource_bytes).expect("Failed to load resources");
88
gio::resources_register(&resources);
99

1010
}

0 commit comments

Comments
 (0)