Skip to content

Commit

Permalink
feat(backend): modify google_drive3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Mar 16, 2022
1 parent ace2ec9 commit c227e78
Show file tree
Hide file tree
Showing 10 changed files with 18,233 additions and 16 deletions.
27 changes: 14 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ members = [
"anni-clap-handler-derive",
"anni-flac",
"anni-repo",

"third_party/google-drive3"
]
4 changes: 2 additions & 2 deletions anni-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ thiserror = "1.0"
anni-repo = { path = "../anni-repo", features = ["db"] }
log = "0.4.0"

google-drive3 = "*"
yup-oauth2 = "^5.0"
google-drive3 = { path = "../third_party/google-drive3" }
yup-oauth2 = "^6.0"
hyper = { version = "^0.14", features = ["stream"] }
hyper-rustls = "^0.22"

Expand Down
2 changes: 1 addition & 1 deletion anni-backend/src/backends/drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl DriveBackend {
return Some((disc_index, file.id.as_deref().unwrap().to_string()));
}).collect();
discs.sort();
// discs.sorted_by_key(|(disc_index, _)| *disc_index).collect();
self.discs.insert(album_id.to_string(), Some(discs.into_iter().map(|(_, id)| id).collect()));
}

Expand All @@ -152,6 +151,7 @@ impl DriveBackend {
let (resp, _) = self.hub.files().get(file_id)
.supports_all_drives(true)
.param("alt", "media")
// .range(format!("bytes=0-"))
.doit().await?;
drop(permit);
let body = resp.into_body()
Expand Down
31 changes: 31 additions & 0 deletions third_party/google-drive3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# DO NOT EDIT !
# This file was generated automatically from 'src/mako/Cargo.toml.mako'
# DO NOT EDIT !
[package]

name = "google-drive3"
version = "3.0.0+20220225"
authors = ["Sebastian Thiel <[email protected]>"]
description = "A complete library to interact with drive (protocol v3)"
repository = "https://github.com/Byron/google-apis-rs/tree/main/gen/drive3"
homepage = "https://developers.google.com/drive/"
documentation = "https://docs.rs/google-drive3/3.0.0+20220225"
license = "MIT"
keywords = ["drive", "google", "protocol", "web", "api"]
autobins = false
edition = "2018"


[dependencies]
hyper-rustls = "^0.22"
mime = "^ 0.2.0"
serde = "^ 1.0"
serde_json = "^ 1.0"
serde_derive = "^ 1.0"
yup-oauth2 = "^ 6.0"
itertools = "^ 0.10"
hyper = "^ 0.14"
url = "= 1.7"



30 changes: 30 additions & 0 deletions third_party/google-drive3/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!---
DO NOT EDIT !
This file was generated automatically from 'src/mako/LICENSE.md.mako'
DO NOT EDIT !
-->
The MIT License (MIT)
=====================

Copyright © `2015-2020` `Sebastian Thiel`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit c227e78

Please sign in to comment.