sources: add owner to RepositoryInfo
This commit is contained in:
@@ -77,6 +77,7 @@ pub enum RepositoryVisibility {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct RepositoryInfo {
|
||||
pub owner: String,
|
||||
pub name: String,
|
||||
pub url: String,
|
||||
pub icon_url: Option<String>,
|
||||
|
||||
@@ -64,6 +64,7 @@ impl KagamiSource for KagamiSourceGitea {
|
||||
|
||||
for r in repos_resp.iter() {
|
||||
let info = RepositoryInfo {
|
||||
owner: r.owner.login.clone(),
|
||||
name: r.name.clone(),
|
||||
url: r.html_url.clone(),
|
||||
icon_url: if r.avatar_url.is_empty() {
|
||||
@@ -133,6 +134,7 @@ impl KagamiSource for KagamiSourceGitea {
|
||||
|
||||
for r in repos_resp.iter() {
|
||||
let info = RepositoryInfo {
|
||||
owner: r.owner.login.clone(),
|
||||
name: r.name.clone(),
|
||||
url: r.html_url.clone(),
|
||||
icon_url: if r.avatar_url.is_empty() {
|
||||
@@ -200,6 +202,7 @@ impl KagamiSource for KagamiSourceGitea {
|
||||
|
||||
for r in repos_resp.iter() {
|
||||
let info = RepositoryInfo {
|
||||
owner: r.owner.login.clone(),
|
||||
name: r.name.clone(),
|
||||
url: r.html_url.clone(),
|
||||
icon_url: if r.avatar_url.is_empty() {
|
||||
|
||||
@@ -195,6 +195,7 @@ impl KagamiSource for KagamiSourceGithub {
|
||||
|
||||
fn map_github_repo_to_info(r: &models::Repository) -> RepositoryInfo {
|
||||
RepositoryInfo {
|
||||
owner: r.owner.as_ref().map(|o| o.login.clone()).unwrap(),
|
||||
name: r.name.clone(),
|
||||
// TODO: don't unwrap with string default here
|
||||
url: r
|
||||
|
||||
Reference in New Issue
Block a user