feat: basic support rss
This commit is contained in:
parent
cde3361458
commit
9fd3ae6563
@ -500,31 +500,31 @@ async fn merge_mikan_classic_episodes_and_strip_columns() -> RecorderResult<()>
|
||||
}
|
||||
|
||||
select_columns_and_write(merged_df.clone(), "tiny", &["fansub_name", "original_name"])?;
|
||||
select_columns_and_write(
|
||||
merged_df.clone(),
|
||||
"lite",
|
||||
&[
|
||||
"mikan_fansub_id",
|
||||
"fansub_name",
|
||||
"mikan_episode_id",
|
||||
"original_name",
|
||||
],
|
||||
)?;
|
||||
select_columns_and_write(
|
||||
merged_df,
|
||||
"full",
|
||||
&[
|
||||
"id",
|
||||
"publish_at_timestamp",
|
||||
"mikan_fansub_id",
|
||||
"fansub_name",
|
||||
"mikan_episode_id",
|
||||
"original_name",
|
||||
"magnet_link",
|
||||
"file_size",
|
||||
"torrent_link",
|
||||
],
|
||||
)?;
|
||||
// select_columns_and_write(
|
||||
// merged_df.clone(),
|
||||
// "lite",
|
||||
// &[
|
||||
// "mikan_fansub_id",
|
||||
// "fansub_name",
|
||||
// "mikan_episode_id",
|
||||
// "original_name",
|
||||
// ],
|
||||
// )?;
|
||||
// select_columns_and_write(
|
||||
// merged_df,
|
||||
// "full",
|
||||
// &[
|
||||
// "id",
|
||||
// "publish_at_timestamp",
|
||||
// "mikan_fansub_id",
|
||||
// "fansub_name",
|
||||
// "mikan_episode_id",
|
||||
// "original_name",
|
||||
// "magnet_link",
|
||||
// "file_size",
|
||||
// "torrent_link",
|
||||
// ],
|
||||
// )?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -53,14 +53,15 @@ impl App {
|
||||
|
||||
let mut router = Router::<Arc<dyn AppContextTrait>>::new();
|
||||
|
||||
let (graphql_c, oidc_c, metadata_c, static_c) = futures::try_join!(
|
||||
let (graphql_c, oidc_c, metadata_c, static_c, feeds_c) = futures::try_join!(
|
||||
controller::graphql::create(context.clone()),
|
||||
controller::oidc::create(context.clone()),
|
||||
controller::metadata::create(context.clone()),
|
||||
controller::r#static::create(context.clone()),
|
||||
controller::feeds::create(context.clone()),
|
||||
)?;
|
||||
|
||||
for c in [graphql_c, oidc_c, metadata_c, static_c] {
|
||||
for c in [graphql_c, oidc_c, metadata_c, static_c, feeds_c] {
|
||||
router = c.apply_to(router);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ pub struct EpisodeEnclosureMeta {
|
||||
pub magnet_link: Option<String>,
|
||||
pub torrent_link: Option<String>,
|
||||
pub pub_date: Option<DateTime<Utc>>,
|
||||
pub content_length: Option<u64>,
|
||||
pub content_length: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
|
@ -41,7 +41,7 @@ use crate::{
|
||||
pub struct MikanRssEpisodeItem {
|
||||
pub title: String,
|
||||
pub torrent_link: Url,
|
||||
pub content_length: Option<u64>,
|
||||
pub content_length: Option<i64>,
|
||||
pub mime: String,
|
||||
pub pub_date: Option<DateTime<Utc>>,
|
||||
pub mikan_episode_id: String,
|
||||
@ -95,15 +95,32 @@ impl TryFrom<rss::Item> for MikanRssEpisodeItem {
|
||||
RecorderError::from_mikan_rss_invalid_field(Cow::Borrowed("mikan_episode_id"))
|
||||
})?;
|
||||
|
||||
let pub_date = item
|
||||
.extensions
|
||||
.get("torrent")
|
||||
.and_then(|t| t.get("pubDate"))
|
||||
.and_then(|e| e.first())
|
||||
.and_then(|e| e.value.as_deref());
|
||||
|
||||
Ok(MikanRssEpisodeItem {
|
||||
title,
|
||||
torrent_link: enclosure_url,
|
||||
content_length: enclosure.length.parse().ok(),
|
||||
mime: mime_type,
|
||||
pub_date: item.pub_date.and_then(|s| {
|
||||
DateTime::parse_from_rfc2822(&s)
|
||||
pub_date: pub_date.and_then(|s| {
|
||||
DateTime::parse_from_rfc2822(s)
|
||||
.ok()
|
||||
.map(|s| s.with_timezone(&Utc))
|
||||
.or_else(|| {
|
||||
DateTime::parse_from_rfc3339(s)
|
||||
.ok()
|
||||
.map(|s| s.with_timezone(&Utc))
|
||||
})
|
||||
.or_else(|| {
|
||||
DateTime::parse_from_rfc3339(&format!("{s}+08:00"))
|
||||
.ok()
|
||||
.map(|s| s.with_timezone(&Utc))
|
||||
})
|
||||
}),
|
||||
mikan_episode_id,
|
||||
magnet_link: None,
|
||||
|
@ -1,9 +1,50 @@
|
||||
use seaography::{Builder as SeaographyBuilder, BuilderContext};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{graphql::domains::subscribers::restrict_subscriber_for_entity, models::feeds};
|
||||
use async_graphql::dynamic::ResolverContext;
|
||||
use sea_orm::Value as SeaValue;
|
||||
use seaography::{Builder as SeaographyBuilder, BuilderContext, SeaResult};
|
||||
|
||||
use crate::{
|
||||
graphql::{
|
||||
domains::subscribers::restrict_subscriber_for_entity,
|
||||
infra::util::{get_entity_column_key, get_entity_key},
|
||||
},
|
||||
models::feeds,
|
||||
};
|
||||
|
||||
pub fn register_feeds_to_schema_context(context: &mut BuilderContext) {
|
||||
restrict_subscriber_for_entity::<feeds::Entity>(context, &feeds::Column::SubscriberId);
|
||||
{
|
||||
let entity_column_key =
|
||||
get_entity_column_key::<feeds::Entity>(context, &feeds::Column::Token);
|
||||
let entity_key = get_entity_key::<feeds::Entity>(context);
|
||||
let entity_name = context.entity_query_field.type_name.as_ref()(&entity_key);
|
||||
let entity_create_one_mutation_field_name = Arc::new(format!(
|
||||
"{}{}",
|
||||
entity_name, context.entity_create_one_mutation.mutation_suffix
|
||||
));
|
||||
let entity_create_batch_mutation_field_name = Arc::new(format!(
|
||||
"{}{}",
|
||||
entity_name,
|
||||
context.entity_create_batch_mutation.mutation_suffix.clone()
|
||||
));
|
||||
|
||||
context.types.input_none_conversions.insert(
|
||||
entity_column_key,
|
||||
Box::new(
|
||||
move |context: &ResolverContext| -> SeaResult<Option<SeaValue>> {
|
||||
let field_name = context.field().name();
|
||||
if field_name == entity_create_one_mutation_field_name.as_str()
|
||||
|| field_name == entity_create_batch_mutation_field_name.as_str()
|
||||
{
|
||||
Ok(Some(SeaValue::String(Some(Box::new(nanoid::nanoid!())))))
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn register_feeds_to_schema_builder(mut builder: SeaographyBuilder) -> SeaographyBuilder {
|
||||
|
@ -267,7 +267,6 @@ where
|
||||
Box::new(
|
||||
move |context: &ResolverContext| -> SeaResult<Option<SeaValue>> {
|
||||
let field_name = context.field().name();
|
||||
tracing::warn!("field_name: {:?}", field_name);
|
||||
if field_name == entity_create_one_mutation_field_name.as_str()
|
||||
|| field_name == entity_create_batch_mutation_field_name.as_str()
|
||||
{
|
||||
|
@ -79,6 +79,9 @@ pub enum Episodes {
|
||||
BangumiId,
|
||||
SubscriberId,
|
||||
DownloadId,
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
SavePath,
|
||||
Resolution,
|
||||
Season,
|
||||
|
@ -95,8 +95,8 @@ impl MigrationTrait for Migration {
|
||||
DownloadMimeEnum,
|
||||
DownloadMime::iden_values(),
|
||||
))
|
||||
.col(big_unsigned(Downloads::AllSize))
|
||||
.col(big_unsigned(Downloads::CurrSize))
|
||||
.col(big_integer(Downloads::AllSize))
|
||||
.col(big_integer(Downloads::CurrSize))
|
||||
.col(text(Downloads::Url))
|
||||
.col(text_null(Downloads::Homepage))
|
||||
.col(text_null(Downloads::SavePath))
|
||||
|
@ -1,8 +1,5 @@
|
||||
use async_trait::async_trait;
|
||||
use sea_orm_migration::{
|
||||
prelude::*,
|
||||
schema::{enumeration, integer_null, pk_auto, text},
|
||||
};
|
||||
use sea_orm_migration::{prelude::*, schema::*};
|
||||
|
||||
use crate::{
|
||||
migrations::defs::{
|
||||
|
@ -1,10 +1,5 @@
|
||||
use async_trait::async_trait;
|
||||
use sea_orm_migration::{
|
||||
prelude::*,
|
||||
schema::{
|
||||
enumeration, enumeration_null, integer_null, text_null, timestamp_with_time_zone_null,
|
||||
},
|
||||
};
|
||||
use sea_orm_migration::{prelude::*, schema::*};
|
||||
|
||||
use crate::{
|
||||
migrations::defs::{Bangumi, CustomSchemaManagerExt, Episodes},
|
||||
@ -85,7 +80,10 @@ impl MigrationTrait for Migration {
|
||||
.add_column_if_not_exists(timestamp_with_time_zone_null(
|
||||
Episodes::EnclosurePubDate,
|
||||
))
|
||||
.add_column_if_not_exists(integer_null(Episodes::EnclosureContentLength))
|
||||
.add_column_if_not_exists(big_integer_null(
|
||||
Episodes::EnclosureContentLength,
|
||||
))
|
||||
.drop_column(Episodes::SavePath)
|
||||
.to_owned(),
|
||||
)
|
||||
.await?;
|
||||
|
@ -17,7 +17,7 @@ use crate::{
|
||||
MikanBangumiHash, MikanBangumiMeta, build_mikan_bangumi_subscription_rss_url,
|
||||
scrape_mikan_poster_meta_from_image_url,
|
||||
},
|
||||
origin::{OriginCompTrait, SeasonComp},
|
||||
origin::{BangumiComps, OriginCompTrait},
|
||||
},
|
||||
};
|
||||
|
||||
@ -129,11 +129,12 @@ impl ActiveModel {
|
||||
) -> RecorderResult<Self> {
|
||||
let mikan_client = ctx.mikan();
|
||||
let mikan_base_url = mikan_client.base_url();
|
||||
let season_comp = SeasonComp::parse_comp(&meta.bangumi_title)
|
||||
let season_comp = BangumiComps::parse_comp(&meta.bangumi_title)
|
||||
.ok()
|
||||
.map(|(_, s)| s);
|
||||
.map(|(_, s)| s)
|
||||
.and_then(|s| s.season);
|
||||
let season_index = season_comp.as_ref().map(|s| s.num).unwrap_or(1);
|
||||
let season_raw = season_comp.map(|s| s.source.into_owned());
|
||||
let season_raw = season_comp.map(|s| s.source.to_string());
|
||||
|
||||
let rss_url = build_mikan_bangumi_subscription_rss_url(
|
||||
mikan_base_url.clone(),
|
||||
@ -162,6 +163,7 @@ impl ActiveModel {
|
||||
origin_poster_link: ActiveValue::Set(meta.origin_poster_src.map(|src| src.to_string())),
|
||||
homepage: ActiveValue::Set(Some(meta.homepage.to_string())),
|
||||
rss_link: ActiveValue::Set(Some(rss_url.to_string())),
|
||||
bangumi_type: ActiveValue::Set(BangumiType::Mikan),
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ pub struct Model {
|
||||
pub status: DownloadStatus,
|
||||
pub mime: DownloadMime,
|
||||
pub url: String,
|
||||
pub all_size: Option<u64>,
|
||||
pub curr_size: Option<u64>,
|
||||
pub all_size: Option<i64>,
|
||||
pub curr_size: Option<i64>,
|
||||
pub homepage: Option<String>,
|
||||
pub save_path: Option<String>,
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ pub struct Model {
|
||||
pub enclosure_torrent_link: Option<String>,
|
||||
pub enclosure_magnet_link: Option<String>,
|
||||
pub enclosure_pub_date: Option<DateTimeUtc>,
|
||||
pub enclosure_content_length: Option<u64>,
|
||||
pub enclosure_content_length: Option<i64>,
|
||||
pub episode_type: EpisodeType,
|
||||
pub origin_name: String,
|
||||
pub display_name: String,
|
||||
@ -166,6 +166,7 @@ impl ActiveModel {
|
||||
enclosure_magnet_link: ActiveValue::Set(enclosure_meta.magnet_link),
|
||||
enclosure_pub_date: ActiveValue::Set(enclosure_meta.pub_date),
|
||||
enclosure_content_length: ActiveValue::Set(enclosure_meta.content_length),
|
||||
episode_type: ActiveValue::Set(EpisodeType::Mikan),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,9 @@ pub enum FeedSource {
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "feeds")]
|
||||
pub struct Model {
|
||||
#[sea_orm(default_expr = "Expr::current_timestamp()")]
|
||||
pub created_at: DateTimeUtc,
|
||||
#[sea_orm(default_expr = "Expr::current_timestamp()")]
|
||||
pub updated_at: DateTimeUtc,
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use rss::Channel;
|
||||
use sea_orm::{ColumnTrait, EntityTrait, QueryFilter};
|
||||
use sea_orm::{ColumnTrait, EntityTrait, JoinType, QueryFilter, QuerySelect, RelationTrait};
|
||||
use url::Url;
|
||||
|
||||
use crate::{
|
||||
@ -8,7 +8,7 @@ use crate::{
|
||||
models::{
|
||||
episodes,
|
||||
feeds::{self, FeedSource, RssFeedTrait, SubscriptionEpisodesFeed},
|
||||
subscriptions,
|
||||
subscription_episode, subscriptions,
|
||||
},
|
||||
};
|
||||
|
||||
@ -22,19 +22,30 @@ impl Feed {
|
||||
FeedSource::SubscriptionEpisode => {
|
||||
let db = ctx.db();
|
||||
let (subscription, episodes) = if let Some(subscription_id) = m.subscription_id
|
||||
&& let Some((subscription, episodes)) = subscriptions::Entity::find()
|
||||
&& let Some(subscription) = subscriptions::Entity::find()
|
||||
.filter(subscriptions::Column::Id.eq(subscription_id))
|
||||
.find_with_related(episodes::Entity)
|
||||
.all(db)
|
||||
.one(db)
|
||||
.await?
|
||||
.pop()
|
||||
{
|
||||
let episodes = episodes::Entity::find()
|
||||
.join(
|
||||
JoinType::InnerJoin,
|
||||
episodes::Relation::SubscriptionEpisode.def(),
|
||||
)
|
||||
.join(
|
||||
JoinType::InnerJoin,
|
||||
subscription_episode::Relation::Subscription.def(),
|
||||
)
|
||||
.filter(subscriptions::Column::Id.eq(subscription_id))
|
||||
.all(db)
|
||||
.await?;
|
||||
(subscription, episodes)
|
||||
} else {
|
||||
return Err(RecorderError::ModelEntityNotFound {
|
||||
entity: "Subscription".into(),
|
||||
});
|
||||
};
|
||||
|
||||
Ok(Feed::SubscritpionEpisodes(
|
||||
SubscriptionEpisodesFeed::from_model(m, subscription, episodes),
|
||||
))
|
||||
|
@ -23,7 +23,7 @@ pub trait RssFeedItemTrait: Sized {
|
||||
fn get_enclosure_link(&self, ctx: &dyn AppContextTrait, api_base: &Url)
|
||||
-> Option<Cow<'_, str>>;
|
||||
fn get_enclosure_pub_date(&self) -> Option<DateTime<Utc>>;
|
||||
fn get_enclosure_content_length(&self) -> Option<u64>;
|
||||
fn get_enclosure_content_length(&self) -> Option<i64>;
|
||||
fn into_item(self, ctx: &dyn AppContextTrait, api_base: &Url) -> RecorderResult<Item> {
|
||||
let enclosure_mime_type =
|
||||
self.get_enclosure_mime()
|
||||
@ -43,12 +43,7 @@ pub trait RssFeedItemTrait: Sized {
|
||||
source: None.into(),
|
||||
}
|
||||
})?;
|
||||
let enclosure_pub_date = self.get_enclosure_pub_date().ok_or_else(|| {
|
||||
RecorderError::MikanRssInvalidFieldError {
|
||||
field: "enclosure_pub_date".into(),
|
||||
source: None.into(),
|
||||
}
|
||||
})?;
|
||||
let enclosure_pub_date = self.get_enclosure_pub_date();
|
||||
let link = self.get_link(ctx, api_base).ok_or_else(|| {
|
||||
RecorderError::MikanRssInvalidFieldError {
|
||||
field: "link".into(),
|
||||
@ -58,9 +53,8 @@ pub trait RssFeedItemTrait: Sized {
|
||||
|
||||
let mut extensions = ExtensionMap::default();
|
||||
if enclosure_mime_type == BITTORRENT_MIME_TYPE {
|
||||
extensions.insert(
|
||||
"torrent".to_string(),
|
||||
btreemap! {
|
||||
extensions.insert("torrent".to_string(), {
|
||||
let mut map = btreemap! {
|
||||
"link".to_string() => vec![
|
||||
ExtensionBuilder::default().name(
|
||||
"link"
|
||||
@ -71,13 +65,20 @@ pub trait RssFeedItemTrait: Sized {
|
||||
"contentLength"
|
||||
).value(enclosure_content_length.to_string()).build()
|
||||
],
|
||||
"pubDate".to_string() => vec![
|
||||
ExtensionBuilder::default().name(
|
||||
"pubDate"
|
||||
).value(enclosure_pub_date.to_rfc3339()).build()
|
||||
],
|
||||
},
|
||||
);
|
||||
};
|
||||
if let Some(pub_date) = enclosure_pub_date {
|
||||
map.insert(
|
||||
"pubDate".to_string(),
|
||||
vec![
|
||||
ExtensionBuilder::default()
|
||||
.name("pubDate")
|
||||
.value(pub_date.to_rfc3339())
|
||||
.build(),
|
||||
],
|
||||
);
|
||||
}
|
||||
map
|
||||
});
|
||||
};
|
||||
|
||||
let enclosure = EnclosureBuilder::default()
|
||||
@ -97,7 +98,6 @@ pub trait RssFeedItemTrait: Sized {
|
||||
.description(self.get_description().to_string())
|
||||
.link(link.to_string())
|
||||
.enclosure(enclosure)
|
||||
.pub_date(enclosure_pub_date.to_rfc3339())
|
||||
.extensions(extensions)
|
||||
.build();
|
||||
|
||||
|
@ -74,7 +74,7 @@ impl RssFeedItemTrait for episodes::Model {
|
||||
self.enclosure_pub_date
|
||||
}
|
||||
|
||||
fn get_enclosure_content_length(&self) -> Option<u64> {
|
||||
fn get_enclosure_content_length(&self) -> Option<i64> {
|
||||
self.enclosure_content_length
|
||||
}
|
||||
}
|
||||
@ -84,8 +84,8 @@ impl RssFeedTrait for SubscriptionEpisodesFeed {
|
||||
|
||||
fn get_description(&self) -> Cow<'_, str> {
|
||||
Cow::Owned(format!(
|
||||
"{PROJECT_NAME} - episodes of subscription \"{}\"",
|
||||
self.subscription.display_name
|
||||
"{PROJECT_NAME} - episodes of subscription {}",
|
||||
self.subscription.id
|
||||
))
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,10 @@ pub enum Relation {
|
||||
Auth,
|
||||
#[sea_orm(has_many = "super::credential_3rd::Entity")]
|
||||
Credential3rd,
|
||||
#[sea_orm(has_many = "super::feeds::Entity")]
|
||||
Feed,
|
||||
#[sea_orm(has_many = "super::subscriber_tasks::Entity")]
|
||||
SubscriberTask,
|
||||
}
|
||||
|
||||
impl Related<super::subscriptions::Entity> for Entity {
|
||||
@ -79,6 +83,18 @@ impl Related<super::credential_3rd::Entity> for Entity {
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::feeds::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Feed.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::subscriber_tasks::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::SubscriberTask.def()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelatedEntity)]
|
||||
pub enum RelatedEntity {
|
||||
#[sea_orm(entity = "super::subscriptions::Entity")]
|
||||
@ -91,6 +107,10 @@ pub enum RelatedEntity {
|
||||
Episode,
|
||||
#[sea_orm(entity = "super::credential_3rd::Entity")]
|
||||
Credential3rd,
|
||||
#[sea_orm(entity = "super::feeds::Entity")]
|
||||
Feed,
|
||||
#[sea_orm(entity = "super::subscriber_tasks::Entity")]
|
||||
SubscriberTask,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
|
@ -59,6 +59,8 @@ pub enum Relation {
|
||||
on_delete = "SetNull"
|
||||
)]
|
||||
Credential3rd,
|
||||
#[sea_orm(has_many = "super::feeds::Entity")]
|
||||
Feed,
|
||||
}
|
||||
|
||||
impl Related<super::subscribers::Entity> for Entity {
|
||||
@ -93,6 +95,12 @@ impl Related<super::bangumi::Entity> for Entity {
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::feeds::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Feed.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::episodes::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
super::subscription_episode::Relation::Episode.def()
|
||||
@ -127,6 +135,8 @@ pub enum RelatedEntity {
|
||||
SubscriptionBangumi,
|
||||
#[sea_orm(entity = "super::credential_3rd::Entity")]
|
||||
Credential3rd,
|
||||
#[sea_orm(entity = "super::feeds::Entity")]
|
||||
Feed,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use axum::{
|
||||
Extension, Router,
|
||||
Router,
|
||||
extract::{Path, State},
|
||||
response::IntoResponse,
|
||||
routing::get,
|
||||
@ -21,21 +21,22 @@ pub const CONTROLLER_PREFIX: &str = "/api/feeds";
|
||||
async fn rss_handler(
|
||||
State(ctx): State<Arc<dyn AppContextTrait>>,
|
||||
Path(token): Path<String>,
|
||||
forwarded_info: Extension<ForwardedRelatedInfo>,
|
||||
forwarded_info: ForwardedRelatedInfo,
|
||||
) -> RecorderResult<impl IntoResponse> {
|
||||
let api_base = forwarded_info
|
||||
.resolved_origin()
|
||||
.ok_or(RecorderError::MissingOriginError)?;
|
||||
let channel = feeds::Model::find_rss_feed_by_token(ctx.as_ref(), &token, &api_base).await?;
|
||||
|
||||
Ok((
|
||||
StatusCode::OK,
|
||||
[("Content-Type", "application/rss+xml")],
|
||||
[("Content-Type", "application/xml; charset=utf-8")],
|
||||
channel.to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn create(_ctx: Arc<dyn AppContextTrait>) -> RecorderResult<Controller> {
|
||||
let router = Router::<Arc<dyn AppContextTrait>>::new().route("rss/{token}", get(rss_handler));
|
||||
let router = Router::<Arc<dyn AppContextTrait>>::new().route("/rss/{token}", get(rss_handler));
|
||||
|
||||
Ok(Controller::from_prefix(CONTROLLER_PREFIX, router))
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use axum::{
|
||||
Extension, Json, Router,
|
||||
Json, Router,
|
||||
extract::{Query, State},
|
||||
routing::get,
|
||||
};
|
||||
@ -42,7 +42,7 @@ async fn oidc_callback(
|
||||
|
||||
async fn oidc_auth(
|
||||
State(ctx): State<Arc<dyn AppContextTrait>>,
|
||||
forwarded_info: Extension<ForwardedRelatedInfo>,
|
||||
forwarded_info: ForwardedRelatedInfo,
|
||||
) -> Result<Json<OidcAuthRequest>, AuthError> {
|
||||
let auth_service = ctx.auth();
|
||||
if let AuthService::Oidc(oidc_auth_service) = auth_service {
|
||||
|
19
apps/webui/src/domains/recorder/schema/feeds.ts
Normal file
19
apps/webui/src/domains/recorder/schema/feeds.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const INSERT_FEED = gql`
|
||||
mutation InsertFeed($data: FeedsInsertInput!) {
|
||||
feedsCreateOne(data: $data) {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
feedType
|
||||
token
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_FEED = gql`
|
||||
mutation DeleteFeed($filters: FeedsFilterInput!) {
|
||||
feedsDelete(filter: $filters)
|
||||
}
|
||||
`;
|
@ -95,6 +95,16 @@ query GetSubscriptionDetail ($id: Int!) {
|
||||
category
|
||||
sourceUrl
|
||||
enabled
|
||||
feed {
|
||||
nodes {
|
||||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
token
|
||||
feedType
|
||||
feedSource
|
||||
}
|
||||
}
|
||||
credential3rd {
|
||||
id
|
||||
username
|
||||
@ -112,7 +122,6 @@ query GetSubscriptionDetail ($id: Int!) {
|
||||
mikanFansubId
|
||||
rssLink
|
||||
posterLink
|
||||
savePath
|
||||
homepage
|
||||
}
|
||||
}
|
||||
|
@ -20,11 +20,13 @@ type Documents = {
|
||||
"\n mutation DeleteCredential3rd($filters: Credential3rdFilterInput!) {\n credential3rdDelete(filter: $filters)\n }\n": typeof types.DeleteCredential3rdDocument,
|
||||
"\n query GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n }\n": typeof types.GetCredential3rdDetailDocument,
|
||||
"\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n": typeof types.CheckCredential3rdAvailableDocument,
|
||||
"\n mutation InsertFeed($data: FeedsInsertInput!) {\n feedsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n feedType\n token\n }\n }\n": typeof types.InsertFeedDocument,
|
||||
"\n mutation DeleteFeed($filters: FeedsFilterInput!) {\n feedsDelete(filter: $filters)\n }\n": typeof types.DeleteFeedDocument,
|
||||
"\n query GetSubscriptions($filters: SubscriptionsFilterInput!, $orderBy: SubscriptionsOrderInput!, $pagination: PaginationInput!) {\n subscriptions(\n pagination: $pagination\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": typeof types.GetSubscriptionsDocument,
|
||||
"\n mutation InsertSubscription($data: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n }\n": typeof types.InsertSubscriptionDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": typeof types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": typeof types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n feed {\n nodes {\n id\n createdAt\n updatedAt\n token\n feedType\n feedSource\n }\n }\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\n mutation SyncSubscriptionFeedsIncremental($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneFeedsIncremental(filter: $filter) {\n id\n }\n }\n": typeof types.SyncSubscriptionFeedsIncrementalDocument,
|
||||
"\n mutation SyncSubscriptionFeedsFull($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneFeedsFull(filter: $filter) {\n id\n }\n }\n": typeof types.SyncSubscriptionFeedsFullDocument,
|
||||
"\n mutation SyncSubscriptionSources($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneSources(filter: $filter) {\n id\n }\n }\n": typeof types.SyncSubscriptionSourcesDocument,
|
||||
@ -39,11 +41,13 @@ const documents: Documents = {
|
||||
"\n mutation DeleteCredential3rd($filters: Credential3rdFilterInput!) {\n credential3rdDelete(filter: $filters)\n }\n": types.DeleteCredential3rdDocument,
|
||||
"\n query GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n }\n": types.GetCredential3rdDetailDocument,
|
||||
"\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n": types.CheckCredential3rdAvailableDocument,
|
||||
"\n mutation InsertFeed($data: FeedsInsertInput!) {\n feedsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n feedType\n token\n }\n }\n": types.InsertFeedDocument,
|
||||
"\n mutation DeleteFeed($filters: FeedsFilterInput!) {\n feedsDelete(filter: $filters)\n }\n": types.DeleteFeedDocument,
|
||||
"\n query GetSubscriptions($filters: SubscriptionsFilterInput!, $orderBy: SubscriptionsOrderInput!, $pagination: PaginationInput!) {\n subscriptions(\n pagination: $pagination\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": types.GetSubscriptionsDocument,
|
||||
"\n mutation InsertSubscription($data: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n }\n": types.InsertSubscriptionDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n feed {\n nodes {\n id\n createdAt\n updatedAt\n token\n feedType\n feedSource\n }\n }\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\n mutation SyncSubscriptionFeedsIncremental($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneFeedsIncremental(filter: $filter) {\n id\n }\n }\n": types.SyncSubscriptionFeedsIncrementalDocument,
|
||||
"\n mutation SyncSubscriptionFeedsFull($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneFeedsFull(filter: $filter) {\n id\n }\n }\n": types.SyncSubscriptionFeedsFullDocument,
|
||||
"\n mutation SyncSubscriptionSources($filter: SubscriptionsFilterInput!) {\n subscriptionsSyncOneSources(filter: $filter) {\n id\n }\n }\n": types.SyncSubscriptionSourcesDocument,
|
||||
@ -90,6 +94,14 @@ export function gql(source: "\n query GetCredential3rdDetail($id: Int!) {\n
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n"): (typeof documents)["\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\n mutation InsertFeed($data: FeedsInsertInput!) {\n feedsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n feedType\n token\n }\n }\n"): (typeof documents)["\n mutation InsertFeed($data: FeedsInsertInput!) {\n feedsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n feedType\n token\n }\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\n mutation DeleteFeed($filters: FeedsFilterInput!) {\n feedsDelete(filter: $filters)\n }\n"): (typeof documents)["\n mutation DeleteFeed($filters: FeedsFilterInput!) {\n feedsDelete(filter: $filters)\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@ -109,7 +121,7 @@ export function gql(source: "\n mutation DeleteSubscriptions($filters: Subscr
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n"): (typeof documents)["\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n"];
|
||||
export function gql(source: "\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n feed {\n nodes {\n id\n createdAt\n updatedAt\n token\n feedType\n feedSource\n }\n }\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n homepage\n }\n }\n }\n }\n}\n"): (typeof documents)["\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n feed {\n nodes {\n id\n createdAt\n updatedAt\n token\n feedType\n feedSource\n }\n }\n credential3rd {\n id\n username\n }\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n homepage\n }\n }\n }\n }\n}\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@ export type Scalars = {
|
||||
|
||||
export type Bangumi = {
|
||||
__typename?: 'Bangumi';
|
||||
bangumiType: BangumiTypeEnum;
|
||||
createdAt: Scalars['String']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
episode: EpisodesConnection;
|
||||
@ -34,7 +35,6 @@ export type Bangumi = {
|
||||
originPosterLink?: Maybe<Scalars['String']['output']>;
|
||||
posterLink?: Maybe<Scalars['String']['output']>;
|
||||
rssLink?: Maybe<Scalars['String']['output']>;
|
||||
savePath?: Maybe<Scalars['String']['output']>;
|
||||
season: Scalars['Int']['output'];
|
||||
seasonRaw?: Maybe<Scalars['String']['output']>;
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
@ -67,6 +67,7 @@ export type BangumiSubscriptionBangumiArgs = {
|
||||
|
||||
export type BangumiBasic = {
|
||||
__typename?: 'BangumiBasic';
|
||||
bangumiType: BangumiTypeEnum;
|
||||
createdAt: Scalars['String']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
@ -79,7 +80,6 @@ export type BangumiBasic = {
|
||||
originPosterLink?: Maybe<Scalars['String']['output']>;
|
||||
posterLink?: Maybe<Scalars['String']['output']>;
|
||||
rssLink?: Maybe<Scalars['String']['output']>;
|
||||
savePath?: Maybe<Scalars['String']['output']>;
|
||||
season: Scalars['Int']['output'];
|
||||
seasonRaw?: Maybe<Scalars['String']['output']>;
|
||||
subscriberId: Scalars['Int']['output'];
|
||||
@ -102,6 +102,7 @@ export type BangumiEdge = {
|
||||
|
||||
export type BangumiFilterInput = {
|
||||
and?: InputMaybe<Array<BangumiFilterInput>>;
|
||||
bangumiType?: InputMaybe<BangumiTypeEnumFilterInput>;
|
||||
createdAt?: InputMaybe<TextFilterInput>;
|
||||
displayName?: InputMaybe<StringFilterInput>;
|
||||
fansub?: InputMaybe<StringFilterInput>;
|
||||
@ -114,14 +115,14 @@ export type BangumiFilterInput = {
|
||||
originPosterLink?: InputMaybe<StringFilterInput>;
|
||||
posterLink?: InputMaybe<StringFilterInput>;
|
||||
rssLink?: InputMaybe<StringFilterInput>;
|
||||
savePath?: InputMaybe<StringFilterInput>;
|
||||
season?: InputMaybe<IntegerFilterInput>;
|
||||
seasonRaw?: InputMaybe<StringFilterInput>;
|
||||
subscriberId?: InputMaybe<IntegerFilterInput>;
|
||||
subscriberId?: InputMaybe<SubscriberIdFilterInput>;
|
||||
updatedAt?: InputMaybe<TextFilterInput>;
|
||||
};
|
||||
|
||||
export type BangumiInsertInput = {
|
||||
bangumiType: BangumiTypeEnum;
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
displayName: Scalars['String']['input'];
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -134,14 +135,14 @@ export type BangumiInsertInput = {
|
||||
originPosterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
posterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
rssLink?: InputMaybe<Scalars['String']['input']>;
|
||||
savePath?: InputMaybe<Scalars['String']['input']>;
|
||||
season: Scalars['Int']['input'];
|
||||
seasonRaw?: InputMaybe<Scalars['String']['input']>;
|
||||
subscriberId: Scalars['Int']['input'];
|
||||
subscriberId?: InputMaybe<Scalars['Int']['input']>;
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type BangumiOrderInput = {
|
||||
bangumiType?: InputMaybe<OrderByEnum>;
|
||||
createdAt?: InputMaybe<OrderByEnum>;
|
||||
displayName?: InputMaybe<OrderByEnum>;
|
||||
fansub?: InputMaybe<OrderByEnum>;
|
||||
@ -154,14 +155,32 @@ export type BangumiOrderInput = {
|
||||
originPosterLink?: InputMaybe<OrderByEnum>;
|
||||
posterLink?: InputMaybe<OrderByEnum>;
|
||||
rssLink?: InputMaybe<OrderByEnum>;
|
||||
savePath?: InputMaybe<OrderByEnum>;
|
||||
season?: InputMaybe<OrderByEnum>;
|
||||
seasonRaw?: InputMaybe<OrderByEnum>;
|
||||
subscriberId?: InputMaybe<OrderByEnum>;
|
||||
updatedAt?: InputMaybe<OrderByEnum>;
|
||||
};
|
||||
|
||||
export const BangumiTypeEnum = {
|
||||
Mikan: 'mikan'
|
||||
} as const;
|
||||
|
||||
export type BangumiTypeEnum = typeof BangumiTypeEnum[keyof typeof BangumiTypeEnum];
|
||||
export type BangumiTypeEnumFilterInput = {
|
||||
eq?: InputMaybe<BangumiTypeEnum>;
|
||||
gt?: InputMaybe<BangumiTypeEnum>;
|
||||
gte?: InputMaybe<BangumiTypeEnum>;
|
||||
is_in?: InputMaybe<Array<BangumiTypeEnum>>;
|
||||
is_not_in?: InputMaybe<Array<BangumiTypeEnum>>;
|
||||
is_not_null?: InputMaybe<BangumiTypeEnum>;
|
||||
is_null?: InputMaybe<BangumiTypeEnum>;
|
||||
lt?: InputMaybe<BangumiTypeEnum>;
|
||||
lte?: InputMaybe<BangumiTypeEnum>;
|
||||
ne?: InputMaybe<BangumiTypeEnum>;
|
||||
};
|
||||
|
||||
export type BangumiUpdateInput = {
|
||||
bangumiType?: InputMaybe<BangumiTypeEnum>;
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -174,10 +193,8 @@ export type BangumiUpdateInput = {
|
||||
originPosterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
posterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
rssLink?: InputMaybe<Scalars['String']['input']>;
|
||||
savePath?: InputMaybe<Scalars['String']['input']>;
|
||||
season?: InputMaybe<Scalars['Int']['input']>;
|
||||
seasonRaw?: InputMaybe<Scalars['String']['input']>;
|
||||
subscriberId?: InputMaybe<Scalars['Int']['input']>;
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
@ -613,6 +630,24 @@ export type DownloadsUpdateInput = {
|
||||
url?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export const EpisodeTypeEnum = {
|
||||
Mikan: 'mikan'
|
||||
} as const;
|
||||
|
||||
export type EpisodeTypeEnum = typeof EpisodeTypeEnum[keyof typeof EpisodeTypeEnum];
|
||||
export type EpisodeTypeEnumFilterInput = {
|
||||
eq?: InputMaybe<EpisodeTypeEnum>;
|
||||
gt?: InputMaybe<EpisodeTypeEnum>;
|
||||
gte?: InputMaybe<EpisodeTypeEnum>;
|
||||
is_in?: InputMaybe<Array<EpisodeTypeEnum>>;
|
||||
is_not_in?: InputMaybe<Array<EpisodeTypeEnum>>;
|
||||
is_not_null?: InputMaybe<EpisodeTypeEnum>;
|
||||
is_null?: InputMaybe<EpisodeTypeEnum>;
|
||||
lt?: InputMaybe<EpisodeTypeEnum>;
|
||||
lte?: InputMaybe<EpisodeTypeEnum>;
|
||||
ne?: InputMaybe<EpisodeTypeEnum>;
|
||||
};
|
||||
|
||||
export type Episodes = {
|
||||
__typename?: 'Episodes';
|
||||
bangumi?: Maybe<Bangumi>;
|
||||
@ -620,7 +655,12 @@ export type Episodes = {
|
||||
createdAt: Scalars['String']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
download: SubscriptionsConnection;
|
||||
enclosureContentLength?: Maybe<Scalars['Int']['output']>;
|
||||
enclosureMagnetLink?: Maybe<Scalars['String']['output']>;
|
||||
enclosurePubDate?: Maybe<Scalars['String']['output']>;
|
||||
enclosureTorrentLink?: Maybe<Scalars['String']['output']>;
|
||||
episodeIndex: Scalars['Int']['output'];
|
||||
episodeType: EpisodeTypeEnum;
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
homepage?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['Int']['output'];
|
||||
@ -629,7 +669,6 @@ export type Episodes = {
|
||||
originPosterLink?: Maybe<Scalars['String']['output']>;
|
||||
posterLink?: Maybe<Scalars['String']['output']>;
|
||||
resolution?: Maybe<Scalars['String']['output']>;
|
||||
savePath?: Maybe<Scalars['String']['output']>;
|
||||
season: Scalars['Int']['output'];
|
||||
seasonRaw?: Maybe<Scalars['String']['output']>;
|
||||
source?: Maybe<Scalars['String']['output']>;
|
||||
@ -667,7 +706,12 @@ export type EpisodesBasic = {
|
||||
bangumiId: Scalars['Int']['output'];
|
||||
createdAt: Scalars['String']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
enclosureContentLength?: Maybe<Scalars['Int']['output']>;
|
||||
enclosureMagnetLink?: Maybe<Scalars['String']['output']>;
|
||||
enclosurePubDate?: Maybe<Scalars['String']['output']>;
|
||||
enclosureTorrentLink?: Maybe<Scalars['String']['output']>;
|
||||
episodeIndex: Scalars['Int']['output'];
|
||||
episodeType: EpisodeTypeEnum;
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
homepage?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['Int']['output'];
|
||||
@ -676,7 +720,6 @@ export type EpisodesBasic = {
|
||||
originPosterLink?: Maybe<Scalars['String']['output']>;
|
||||
posterLink?: Maybe<Scalars['String']['output']>;
|
||||
resolution?: Maybe<Scalars['String']['output']>;
|
||||
savePath?: Maybe<Scalars['String']['output']>;
|
||||
season: Scalars['Int']['output'];
|
||||
seasonRaw?: Maybe<Scalars['String']['output']>;
|
||||
source?: Maybe<Scalars['String']['output']>;
|
||||
@ -704,7 +747,12 @@ export type EpisodesFilterInput = {
|
||||
bangumiId?: InputMaybe<IntegerFilterInput>;
|
||||
createdAt?: InputMaybe<TextFilterInput>;
|
||||
displayName?: InputMaybe<StringFilterInput>;
|
||||
enclosureContentLength?: InputMaybe<IntegerFilterInput>;
|
||||
enclosureMagnetLink?: InputMaybe<StringFilterInput>;
|
||||
enclosurePubDate?: InputMaybe<TextFilterInput>;
|
||||
enclosureTorrentLink?: InputMaybe<StringFilterInput>;
|
||||
episodeIndex?: InputMaybe<IntegerFilterInput>;
|
||||
episodeType?: InputMaybe<EpisodeTypeEnumFilterInput>;
|
||||
fansub?: InputMaybe<StringFilterInput>;
|
||||
homepage?: InputMaybe<StringFilterInput>;
|
||||
id?: InputMaybe<IntegerFilterInput>;
|
||||
@ -714,7 +762,6 @@ export type EpisodesFilterInput = {
|
||||
originPosterLink?: InputMaybe<StringFilterInput>;
|
||||
posterLink?: InputMaybe<StringFilterInput>;
|
||||
resolution?: InputMaybe<StringFilterInput>;
|
||||
savePath?: InputMaybe<StringFilterInput>;
|
||||
season?: InputMaybe<IntegerFilterInput>;
|
||||
seasonRaw?: InputMaybe<StringFilterInput>;
|
||||
source?: InputMaybe<StringFilterInput>;
|
||||
@ -727,7 +774,12 @@ export type EpisodesInsertInput = {
|
||||
bangumiId: Scalars['Int']['input'];
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
displayName: Scalars['String']['input'];
|
||||
enclosureContentLength?: InputMaybe<Scalars['Int']['input']>;
|
||||
enclosureMagnetLink?: InputMaybe<Scalars['String']['input']>;
|
||||
enclosurePubDate?: InputMaybe<Scalars['String']['input']>;
|
||||
enclosureTorrentLink?: InputMaybe<Scalars['String']['input']>;
|
||||
episodeIndex: Scalars['Int']['input'];
|
||||
episodeType: EpisodeTypeEnum;
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
homepage?: InputMaybe<Scalars['String']['input']>;
|
||||
id?: InputMaybe<Scalars['Int']['input']>;
|
||||
@ -736,7 +788,6 @@ export type EpisodesInsertInput = {
|
||||
originPosterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
posterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
resolution?: InputMaybe<Scalars['String']['input']>;
|
||||
savePath?: InputMaybe<Scalars['String']['input']>;
|
||||
season: Scalars['Int']['input'];
|
||||
seasonRaw?: InputMaybe<Scalars['String']['input']>;
|
||||
source?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -749,7 +800,12 @@ export type EpisodesOrderInput = {
|
||||
bangumiId?: InputMaybe<OrderByEnum>;
|
||||
createdAt?: InputMaybe<OrderByEnum>;
|
||||
displayName?: InputMaybe<OrderByEnum>;
|
||||
enclosureContentLength?: InputMaybe<OrderByEnum>;
|
||||
enclosureMagnetLink?: InputMaybe<OrderByEnum>;
|
||||
enclosurePubDate?: InputMaybe<OrderByEnum>;
|
||||
enclosureTorrentLink?: InputMaybe<OrderByEnum>;
|
||||
episodeIndex?: InputMaybe<OrderByEnum>;
|
||||
episodeType?: InputMaybe<OrderByEnum>;
|
||||
fansub?: InputMaybe<OrderByEnum>;
|
||||
homepage?: InputMaybe<OrderByEnum>;
|
||||
id?: InputMaybe<OrderByEnum>;
|
||||
@ -758,7 +814,6 @@ export type EpisodesOrderInput = {
|
||||
originPosterLink?: InputMaybe<OrderByEnum>;
|
||||
posterLink?: InputMaybe<OrderByEnum>;
|
||||
resolution?: InputMaybe<OrderByEnum>;
|
||||
savePath?: InputMaybe<OrderByEnum>;
|
||||
season?: InputMaybe<OrderByEnum>;
|
||||
seasonRaw?: InputMaybe<OrderByEnum>;
|
||||
source?: InputMaybe<OrderByEnum>;
|
||||
@ -771,7 +826,12 @@ export type EpisodesUpdateInput = {
|
||||
bangumiId?: InputMaybe<Scalars['Int']['input']>;
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
enclosureContentLength?: InputMaybe<Scalars['Int']['input']>;
|
||||
enclosureMagnetLink?: InputMaybe<Scalars['String']['input']>;
|
||||
enclosurePubDate?: InputMaybe<Scalars['String']['input']>;
|
||||
enclosureTorrentLink?: InputMaybe<Scalars['String']['input']>;
|
||||
episodeIndex?: InputMaybe<Scalars['Int']['input']>;
|
||||
episodeType?: InputMaybe<EpisodeTypeEnum>;
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
homepage?: InputMaybe<Scalars['String']['input']>;
|
||||
id?: InputMaybe<Scalars['Int']['input']>;
|
||||
@ -780,7 +840,6 @@ export type EpisodesUpdateInput = {
|
||||
originPosterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
posterLink?: InputMaybe<Scalars['String']['input']>;
|
||||
resolution?: InputMaybe<Scalars['String']['input']>;
|
||||
savePath?: InputMaybe<Scalars['String']['input']>;
|
||||
season?: InputMaybe<Scalars['Int']['input']>;
|
||||
seasonRaw?: InputMaybe<Scalars['String']['input']>;
|
||||
source?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -788,6 +847,127 @@ export type EpisodesUpdateInput = {
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export const FeedSourceEnum = {
|
||||
SubscriptionEpisode: 'subscription_episode'
|
||||
} as const;
|
||||
|
||||
export type FeedSourceEnum = typeof FeedSourceEnum[keyof typeof FeedSourceEnum];
|
||||
export type FeedSourceEnumFilterInput = {
|
||||
eq?: InputMaybe<FeedSourceEnum>;
|
||||
gt?: InputMaybe<FeedSourceEnum>;
|
||||
gte?: InputMaybe<FeedSourceEnum>;
|
||||
is_in?: InputMaybe<Array<FeedSourceEnum>>;
|
||||
is_not_in?: InputMaybe<Array<FeedSourceEnum>>;
|
||||
is_not_null?: InputMaybe<FeedSourceEnum>;
|
||||
is_null?: InputMaybe<FeedSourceEnum>;
|
||||
lt?: InputMaybe<FeedSourceEnum>;
|
||||
lte?: InputMaybe<FeedSourceEnum>;
|
||||
ne?: InputMaybe<FeedSourceEnum>;
|
||||
};
|
||||
|
||||
export const FeedTypeEnum = {
|
||||
Rss: 'rss'
|
||||
} as const;
|
||||
|
||||
export type FeedTypeEnum = typeof FeedTypeEnum[keyof typeof FeedTypeEnum];
|
||||
export type FeedTypeEnumFilterInput = {
|
||||
eq?: InputMaybe<FeedTypeEnum>;
|
||||
gt?: InputMaybe<FeedTypeEnum>;
|
||||
gte?: InputMaybe<FeedTypeEnum>;
|
||||
is_in?: InputMaybe<Array<FeedTypeEnum>>;
|
||||
is_not_in?: InputMaybe<Array<FeedTypeEnum>>;
|
||||
is_not_null?: InputMaybe<FeedTypeEnum>;
|
||||
is_null?: InputMaybe<FeedTypeEnum>;
|
||||
lt?: InputMaybe<FeedTypeEnum>;
|
||||
lte?: InputMaybe<FeedTypeEnum>;
|
||||
ne?: InputMaybe<FeedTypeEnum>;
|
||||
};
|
||||
|
||||
export type Feeds = {
|
||||
__typename?: 'Feeds';
|
||||
createdAt: Scalars['String']['output'];
|
||||
feedSource: FeedSourceEnum;
|
||||
feedType: FeedTypeEnum;
|
||||
id: Scalars['Int']['output'];
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
subscriberId?: Maybe<Scalars['Int']['output']>;
|
||||
subscription?: Maybe<Subscriptions>;
|
||||
subscriptionId?: Maybe<Scalars['Int']['output']>;
|
||||
token: Scalars['String']['output'];
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type FeedsBasic = {
|
||||
__typename?: 'FeedsBasic';
|
||||
createdAt: Scalars['String']['output'];
|
||||
feedSource: FeedSourceEnum;
|
||||
feedType: FeedTypeEnum;
|
||||
id: Scalars['Int']['output'];
|
||||
subscriberId?: Maybe<Scalars['Int']['output']>;
|
||||
subscriptionId?: Maybe<Scalars['Int']['output']>;
|
||||
token: Scalars['String']['output'];
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type FeedsConnection = {
|
||||
__typename?: 'FeedsConnection';
|
||||
edges: Array<FeedsEdge>;
|
||||
nodes: Array<Feeds>;
|
||||
pageInfo: PageInfo;
|
||||
paginationInfo?: Maybe<PaginationInfo>;
|
||||
};
|
||||
|
||||
export type FeedsEdge = {
|
||||
__typename?: 'FeedsEdge';
|
||||
cursor: Scalars['String']['output'];
|
||||
node: Feeds;
|
||||
};
|
||||
|
||||
export type FeedsFilterInput = {
|
||||
and?: InputMaybe<Array<FeedsFilterInput>>;
|
||||
createdAt?: InputMaybe<TextFilterInput>;
|
||||
feedSource?: InputMaybe<FeedSourceEnumFilterInput>;
|
||||
feedType?: InputMaybe<FeedTypeEnumFilterInput>;
|
||||
id?: InputMaybe<IntegerFilterInput>;
|
||||
or?: InputMaybe<Array<FeedsFilterInput>>;
|
||||
subscriberId?: InputMaybe<SubscriberIdFilterInput>;
|
||||
subscriptionId?: InputMaybe<IntegerFilterInput>;
|
||||
token?: InputMaybe<StringFilterInput>;
|
||||
updatedAt?: InputMaybe<TextFilterInput>;
|
||||
};
|
||||
|
||||
export type FeedsInsertInput = {
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
feedSource: FeedSourceEnum;
|
||||
feedType: FeedTypeEnum;
|
||||
id?: InputMaybe<Scalars['Int']['input']>;
|
||||
subscriberId?: InputMaybe<Scalars['Int']['input']>;
|
||||
subscriptionId?: InputMaybe<Scalars['Int']['input']>;
|
||||
token?: InputMaybe<Scalars['String']['input']>;
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type FeedsOrderInput = {
|
||||
createdAt?: InputMaybe<OrderByEnum>;
|
||||
feedSource?: InputMaybe<OrderByEnum>;
|
||||
feedType?: InputMaybe<OrderByEnum>;
|
||||
id?: InputMaybe<OrderByEnum>;
|
||||
subscriberId?: InputMaybe<OrderByEnum>;
|
||||
subscriptionId?: InputMaybe<OrderByEnum>;
|
||||
token?: InputMaybe<OrderByEnum>;
|
||||
updatedAt?: InputMaybe<OrderByEnum>;
|
||||
};
|
||||
|
||||
export type FeedsUpdateInput = {
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
feedSource?: InputMaybe<FeedSourceEnum>;
|
||||
feedType?: InputMaybe<FeedTypeEnum>;
|
||||
id?: InputMaybe<Scalars['Int']['input']>;
|
||||
subscriptionId?: InputMaybe<Scalars['Int']['input']>;
|
||||
token?: InputMaybe<Scalars['String']['input']>;
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type IntegerFilterInput = {
|
||||
between?: InputMaybe<Array<Scalars['Int']['input']>>;
|
||||
eq?: InputMaybe<Scalars['Int']['input']>;
|
||||
@ -826,6 +1006,10 @@ export type Mutation = {
|
||||
episodesCreateOne: EpisodesBasic;
|
||||
episodesDelete: Scalars['Int']['output'];
|
||||
episodesUpdate: Array<EpisodesBasic>;
|
||||
feedsCreateBatch: Array<FeedsBasic>;
|
||||
feedsCreateOne: FeedsBasic;
|
||||
feedsDelete: Scalars['Int']['output'];
|
||||
feedsUpdate: Array<FeedsBasic>;
|
||||
subscriberTasksDelete: Scalars['Int']['output'];
|
||||
subscriberTasksRetryOne: SubscriberTasks;
|
||||
subscriptionBangumiCreateBatch: Array<SubscriptionBangumiBasic>;
|
||||
@ -951,6 +1135,27 @@ export type MutationEpisodesUpdateArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationFeedsCreateBatchArgs = {
|
||||
data: Array<FeedsInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationFeedsCreateOneArgs = {
|
||||
data: FeedsInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationFeedsDeleteArgs = {
|
||||
filter?: InputMaybe<FeedsFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationFeedsUpdateArgs = {
|
||||
data: FeedsUpdateInput;
|
||||
filter?: InputMaybe<FeedsFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriberTasksDeleteArgs = {
|
||||
filter?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
};
|
||||
@ -1085,6 +1290,7 @@ export type Query = {
|
||||
downloaders: DownloadersConnection;
|
||||
downloads: DownloadsConnection;
|
||||
episodes: EpisodesConnection;
|
||||
feeds: FeedsConnection;
|
||||
subscriberTasks: SubscriberTasksConnection;
|
||||
subscribers: SubscribersConnection;
|
||||
subscriptionBangumi: SubscriptionBangumiConnection;
|
||||
@ -1138,6 +1344,13 @@ export type QueryEpisodesArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryFeedsArgs = {
|
||||
filters?: InputMaybe<FeedsFilterInput>;
|
||||
orderBy?: InputMaybe<FeedsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriberTasksArgs = {
|
||||
filters?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriberTasksOrderInput>;
|
||||
@ -1288,7 +1501,9 @@ export type Subscribers = {
|
||||
displayName: Scalars['String']['output'];
|
||||
downloader: DownloadersConnection;
|
||||
episode: EpisodesConnection;
|
||||
feed: FeedsConnection;
|
||||
id: Scalars['Int']['output'];
|
||||
subscriberTask: SubscriberTasksConnection;
|
||||
subscription: SubscriptionsConnection;
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
@ -1322,6 +1537,20 @@ export type SubscribersEpisodeArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersFeedArgs = {
|
||||
filters?: InputMaybe<FeedsFilterInput>;
|
||||
orderBy?: InputMaybe<FeedsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersSubscriberTaskArgs = {
|
||||
filters?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriberTasksOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersSubscriptionArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
@ -1511,6 +1740,7 @@ export type Subscriptions = {
|
||||
displayName: Scalars['String']['output'];
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
episode: EpisodesConnection;
|
||||
feed: FeedsConnection;
|
||||
id: Scalars['Int']['output'];
|
||||
sourceUrl: Scalars['String']['output'];
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
@ -1535,6 +1765,13 @@ export type SubscriptionsEpisodeArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsFeedArgs = {
|
||||
filters?: InputMaybe<FeedsFilterInput>;
|
||||
orderBy?: InputMaybe<FeedsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsSubscriptionBangumiArgs = {
|
||||
filters?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionBangumiOrderInput>;
|
||||
@ -1684,6 +1921,20 @@ export type CheckCredential3rdAvailableQueryVariables = Exact<{
|
||||
|
||||
export type CheckCredential3rdAvailableQuery = { __typename?: 'Query', credential3rdCheckAvailable: { __typename?: 'Credential3rdCheckAvailableInfo', available: boolean } };
|
||||
|
||||
export type InsertFeedMutationVariables = Exact<{
|
||||
data: FeedsInsertInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type InsertFeedMutation = { __typename?: 'Mutation', feedsCreateOne: { __typename?: 'FeedsBasic', id: number, createdAt: string, updatedAt: string, feedType: FeedTypeEnum, token: string } };
|
||||
|
||||
export type DeleteFeedMutationVariables = Exact<{
|
||||
filters: FeedsFilterInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteFeedMutation = { __typename?: 'Mutation', feedsDelete: number };
|
||||
|
||||
export type GetSubscriptionsQueryVariables = Exact<{
|
||||
filters: SubscriptionsFilterInput;
|
||||
orderBy: SubscriptionsOrderInput;
|
||||
@ -1720,7 +1971,7 @@ export type GetSubscriptionDetailQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetSubscriptionDetailQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, displayName: string, createdAt: string, updatedAt: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean, credential3rd?: { __typename?: 'Credential3rd', id: number, username?: string | null } | null, bangumi: { __typename?: 'BangumiConnection', nodes: Array<{ __typename?: 'Bangumi', createdAt: string, updatedAt: string, id: number, mikanBangumiId?: string | null, displayName: string, season: number, seasonRaw?: string | null, fansub?: string | null, mikanFansubId?: string | null, rssLink?: string | null, posterLink?: string | null, savePath?: string | null, homepage?: string | null }> } }> } };
|
||||
export type GetSubscriptionDetailQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, displayName: string, createdAt: string, updatedAt: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean, feed: { __typename?: 'FeedsConnection', nodes: Array<{ __typename?: 'Feeds', id: number, createdAt: string, updatedAt: string, token: string, feedType: FeedTypeEnum, feedSource: FeedSourceEnum }> }, credential3rd?: { __typename?: 'Credential3rd', id: number, username?: string | null } | null, bangumi: { __typename?: 'BangumiConnection', nodes: Array<{ __typename?: 'Bangumi', createdAt: string, updatedAt: string, id: number, mikanBangumiId?: string | null, displayName: string, season: number, seasonRaw?: string | null, fansub?: string | null, mikanFansubId?: string | null, rssLink?: string | null, posterLink?: string | null, homepage?: string | null }> } }> } };
|
||||
|
||||
export type SyncSubscriptionFeedsIncrementalMutationVariables = Exact<{
|
||||
filter: SubscriptionsFilterInput;
|
||||
@ -1773,11 +2024,13 @@ export const UpdateCredential3rdDocument = {"kind":"Document","definitions":[{"k
|
||||
export const DeleteCredential3rdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteCredential3rd"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rdDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteCredential3rdMutation, DeleteCredential3rdMutationVariables>;
|
||||
export const GetCredential3rdDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCredential3rdDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rd"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"cookies"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"userAgent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"credentialType"}}]}}]}}]}}]} as unknown as DocumentNode<GetCredential3rdDetailQuery, GetCredential3rdDetailQueryVariables>;
|
||||
export const CheckCredential3rdAvailableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CheckCredential3rdAvailable"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rdCheckAvailable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"available"}}]}}]}}]} as unknown as DocumentNode<CheckCredential3rdAvailableQuery, CheckCredential3rdAvailableQueryVariables>;
|
||||
export const InsertFeedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"InsertFeed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedsInsertInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"feedsCreateOne"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"feedType"}},{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]}}]} as unknown as DocumentNode<InsertFeedMutation, InsertFeedMutationVariables>;
|
||||
export const DeleteFeedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteFeed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"FeedsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"feedsDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteFeedMutation, DeleteFeedMutationVariables>;
|
||||
export const GetSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsOrderInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"credentialId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"paginationInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"pages"}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionsQuery, GetSubscriptionsQueryVariables>;
|
||||
export const InsertSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"InsertSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsInsertInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsCreateOne"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"credentialId"}}]}}]}}]} as unknown as DocumentNode<InsertSubscriptionMutation, InsertSubscriptionMutationVariables>;
|
||||
export const UpdateSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsUpdateInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsUpdate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}}]}}]} as unknown as DocumentNode<UpdateSubscriptionsMutation, UpdateSubscriptionsMutationVariables>;
|
||||
export const DeleteSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteSubscriptionsMutation, DeleteSubscriptionsMutationVariables>;
|
||||
export const GetSubscriptionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"credential3rd"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bangumi"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"mikanBangumiId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"season"}},{"kind":"Field","name":{"kind":"Name","value":"seasonRaw"}},{"kind":"Field","name":{"kind":"Name","value":"fansub"}},{"kind":"Field","name":{"kind":"Name","value":"mikanFansubId"}},{"kind":"Field","name":{"kind":"Name","value":"rssLink"}},{"kind":"Field","name":{"kind":"Name","value":"posterLink"}},{"kind":"Field","name":{"kind":"Name","value":"savePath"}},{"kind":"Field","name":{"kind":"Name","value":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const GetSubscriptionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"feed"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"feedType"}},{"kind":"Field","name":{"kind":"Name","value":"feedSource"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"credential3rd"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bangumi"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"mikanBangumiId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"season"}},{"kind":"Field","name":{"kind":"Name","value":"seasonRaw"}},{"kind":"Field","name":{"kind":"Name","value":"fansub"}},{"kind":"Field","name":{"kind":"Name","value":"mikanFansubId"}},{"kind":"Field","name":{"kind":"Name","value":"rssLink"}},{"kind":"Field","name":{"kind":"Name","value":"posterLink"}},{"kind":"Field","name":{"kind":"Name","value":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const SyncSubscriptionFeedsIncrementalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionFeedsIncremental"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsSyncOneFeedsIncremental"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionFeedsIncrementalMutation, SyncSubscriptionFeedsIncrementalMutationVariables>;
|
||||
export const SyncSubscriptionFeedsFullDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionFeedsFull"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsSyncOneFeedsFull"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionFeedsFullMutation, SyncSubscriptionFeedsFullMutationVariables>;
|
||||
export const SyncSubscriptionSourcesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionSources"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsSyncOneSources"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionSourcesMutation, SyncSubscriptionSourcesMutationVariables>;
|
||||
|
@ -14,6 +14,7 @@ import { Img } from '@/components/ui/img';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { QueryErrorView } from '@/components/ui/query-error-view';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { DELETE_FEED, INSERT_FEED } from '@/domains/recorder/schema/feeds';
|
||||
import { GET_SUBSCRIPTION_DETAIL } from '@/domains/recorder/schema/subscriptions';
|
||||
import { SubscriptionService } from '@/domains/recorder/services/subscription.service';
|
||||
import { useInject } from '@/infra/di/inject';
|
||||
@ -22,10 +23,16 @@ import {
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import {
|
||||
type DeleteFeedMutation,
|
||||
type DeleteFeedMutationVariables,
|
||||
FeedSourceEnum,
|
||||
FeedTypeEnum,
|
||||
type GetSubscriptionDetailQuery,
|
||||
type InsertFeedMutation,
|
||||
type InsertFeedMutationVariables,
|
||||
SubscriptionCategoryEnum,
|
||||
} from '@/infra/graphql/gql/graphql';
|
||||
import { useQuery } from '@apollo/client';
|
||||
import { useMutation, useQuery } from '@apollo/client';
|
||||
import {
|
||||
createFileRoute,
|
||||
useCanGoBack,
|
||||
@ -38,7 +45,9 @@ import {
|
||||
Edit,
|
||||
ExternalLink,
|
||||
ListIcon,
|
||||
PlusIcon,
|
||||
RefreshCcwIcon,
|
||||
Trash2,
|
||||
} from 'lucide-react';
|
||||
import { useMemo } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
@ -91,6 +100,50 @@ function SubscriptionDetailRouteComponent() {
|
||||
});
|
||||
};
|
||||
|
||||
const [insertFeed] = useMutation<
|
||||
InsertFeedMutation,
|
||||
InsertFeedMutationVariables
|
||||
>(INSERT_FEED, {
|
||||
onCompleted: async () => {
|
||||
const result = await refetch();
|
||||
const error = getApolloQueryError(result);
|
||||
if (error) {
|
||||
toast.error('Failed to add feed', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
toast.success('Feed added');
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error('Failed to add feed', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const [deleteFeed] = useMutation<
|
||||
DeleteFeedMutation,
|
||||
DeleteFeedMutationVariables
|
||||
>(DELETE_FEED, {
|
||||
onCompleted: async () => {
|
||||
const result = await refetch();
|
||||
const error = getApolloQueryError(result);
|
||||
if (error) {
|
||||
toast.error('Failed to delete feed', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
toast.success('Feed deleted');
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error('Failed to delete feed', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const subscription = data?.subscriptions?.nodes?.[0];
|
||||
|
||||
const sourceUrlMeta = useMemo(
|
||||
@ -314,6 +367,85 @@ function SubscriptionDetailRouteComponent() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="font-medium text-sm">Associated Feeds</Label>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
insertFeed({
|
||||
variables: {
|
||||
data: {
|
||||
subscriptionId: Number.parseInt(id),
|
||||
feedType: FeedTypeEnum.Rss,
|
||||
feedSource: FeedSourceEnum.SubscriptionEpisode,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
>
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
Add Feed
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{subscription.feed?.nodes &&
|
||||
subscription.feed.nodes.length > 0 ? (
|
||||
subscription.feed.nodes.map((feed) => (
|
||||
<Card
|
||||
key={feed.id}
|
||||
className="group relative cursor-pointer p-4 transition-colors hover:bg-accent/50"
|
||||
onClick={() => {
|
||||
window.open(`/api/feeds/rss/${feed.token}`, '_blank');
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="whitespace-nowrap font-medium text-sm capitalize">
|
||||
<span>{feed.feedType} Feed</span>
|
||||
</Label>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 w-6 p-0 opacity-0 transition-opacity group-hover:opacity-100"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
deleteFeed({
|
||||
variables: {
|
||||
filters: {
|
||||
id: {
|
||||
eq: feed.id,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Trash2 className="h-3 w-3 text-destructive" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<code className="break-all rounded bg-muted px-2 py-1 font-mono text-xs">
|
||||
{feed.token}
|
||||
</code>
|
||||
|
||||
<div className="text-muted-foreground text-xs">
|
||||
{format(new Date(feed.createdAt), 'MM-dd HH:mm')}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
))
|
||||
) : (
|
||||
<div className="col-span-full py-8 text-center text-muted-foreground">
|
||||
No associated feeds now
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{subscription.bangumi?.nodes &&
|
||||
subscription.bangumi.nodes.length > 0 && (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user