Skip to content

Commit

Permalink
refactor: rename google-drive3 to anni-google-drive3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Dec 5, 2022
1 parent ae32302 commit 7f0d3b2
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 37 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion anni-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ thiserror = "1.0"
anni-repo = { path = "../anni-repo", features = ["db-read"] }
log = "0.4"

google-drive3 = { path = "../third_party/google-drive3" }
anni-google-drive3 = { path = "../third_party/google-drive3" }

uuid = "1"
sha2 = "0.10.2"
Expand Down
4 changes: 2 additions & 2 deletions anni-provider/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ pub enum ProviderError {
RepoError(#[from] anni_repo::error::Error),

#[error(transparent)]
OAuthError(#[from] google_drive3::oauth2::Error),
OAuthError(#[from] anni_google_drive3::oauth2::Error),

#[error(transparent)]
DriveError(#[from] google_drive3::Error),
DriveError(#[from] anni_google_drive3::Error),

#[error(transparent)]
RequestError(#[from] reqwest::Error),
Expand Down
8 changes: 4 additions & 4 deletions anni-provider/src/providers/drive.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{AnniProvider, AudioInfo, AudioResourceReader, ProviderError, Range, ResourceReader};
use async_trait::async_trait;
use google_drive3::{
use anni_google_drive3::{
hyper, hyper::client::HttpConnector, hyper_rustls::HttpsConnector, oauth2, DriveHub,
};
use async_trait::async_trait;
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::num::NonZeroU8;
Expand All @@ -11,12 +11,12 @@ use std::path::{Path, PathBuf};
use self::oauth2::authenticator::Authenticator;
use self::oauth2::authenticator_delegate::DefaultInstalledFlowDelegate;
use crate::utils::read_duration;
use anni_google_drive3::api::{FileList, FileListCall};
use anni_google_drive3::hyper_rustls::HttpsConnectorBuilder;
use anni_repo::db::RepoDatabaseRead;
use anni_repo::library::{AlbumFolderInfo, DiscFolderInfo};
use dashmap::DashMap;
use futures::TryStreamExt;
use google_drive3::api::{FileList, FileListCall};
use google_drive3::hyper_rustls::HttpsConnectorBuilder;
use parking_lot::Mutex;
use std::str::FromStr;
use tokio::sync::Semaphore;
Expand Down
2 changes: 1 addition & 1 deletion anni/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ chrono = "0.4"
inquire = "0.4.0"
notify = { version = "5.0.0", default-features = false, features = ["macos_kqueue"] }
notify-debouncer-mini = { version = "0.2.1", default-features = false }
google-drive3 = { path = "../third_party/google-drive3" }
anni-google-drive3 = { path = "../third_party/google-drive3" }

[dependencies.reqwest]
version = "0.11.11"
Expand Down
13 changes: 4 additions & 9 deletions third_party/google-drive3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# DO NOT EDIT !
# This file was generated automatically from 'src/mako/Cargo.toml.mako'
# DO NOT EDIT !
[package]

name = "google-drive3"
version = "4.0.0+20220225"
name = "anni-google-drive3"
version = "0.1.0+4.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"
description = "Patched library to interact with drive (protocol v3) with range support"
repository = "https://github.com/ProjectAnni/anni/tree/master/third_party/google-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
Expand Down
6 changes: 6 additions & 0 deletions third_party/google-drive3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ DO NOT EDIT !
This file was generated automatically from 'src/mako/api/README.md.mako'
DO NOT EDIT !
-->

The `google-drive3` library allows access to all features of the *Google drive* service.

This documentation was generated from *drive* crate version *3.0.0+20220225*, where *20220225* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v3.0.0*.

Everything else about the *drive* *v3* API can be found at the
[official documentation site](https://developers.google.com/drive/).

# Patch detail

We patched the original crate to add support for `Range` header used by `get` operations.

# Features

Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/3.0.0+20220225/google_drive3/DriveHub) ...
Expand Down

0 comments on commit 7f0d3b2

Please sign in to comment.