hammond-data::parser : Do not clean image urls cause feeds put redirects for uri for some reason.
This commit is contained in:
parent
8513ba3644
commit
b820ee4db7
@ -112,10 +112,6 @@ impl NewPodcast {
|
|||||||
let con = db.get()?;
|
let con = db.get()?;
|
||||||
match pd {
|
match pd {
|
||||||
Ok(foo) => {
|
Ok(foo) => {
|
||||||
if foo.source_id() != self.source_id {
|
|
||||||
error!("NSPD sid: {}, SPD sid: {}", self.source_id, foo.source_id());
|
|
||||||
};
|
|
||||||
|
|
||||||
if (foo.link() != self.link) || (foo.title() != self.title)
|
if (foo.link() != self.link) || (foo.title() != self.title)
|
||||||
|| (foo.image_uri() != self.image_uri.as_ref().map(|x| x.as_str()))
|
|| (foo.image_uri() != self.image_uri.as_ref().map(|x| x.as_str()))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,9 +17,9 @@ pub(crate) fn new_podcast(chan: &Channel, source_id: i32) -> NewPodcast {
|
|||||||
let link = url_cleaner(chan.link());
|
let link = url_cleaner(chan.link());
|
||||||
let x = chan.itunes_ext().map(|s| s.image());
|
let x = chan.itunes_ext().map(|s| s.image());
|
||||||
let image_uri = if let Some(img) = x {
|
let image_uri = if let Some(img) = x {
|
||||||
img.map(|s| url_cleaner(s))
|
img.map(|s| s.to_owned())
|
||||||
} else {
|
} else {
|
||||||
chan.image().map(|foo| url_cleaner(foo.url()))
|
chan.image().map(|foo| foo.url().to_owned())
|
||||||
};
|
};
|
||||||
|
|
||||||
NewPodcastBuilder::default()
|
NewPodcastBuilder::default()
|
||||||
@ -43,10 +43,6 @@ pub(crate) fn new_episode(item: &Item, parent_id: i32) -> Result<NewEpisode> {
|
|||||||
.map(|s| replace_extra_spaces(&ammonia::clean(s)));
|
.map(|s| replace_extra_spaces(&ammonia::clean(s)));
|
||||||
let guid = item.guid().map(|s| s.value().trim().to_owned());
|
let guid = item.guid().map(|s| s.value().trim().to_owned());
|
||||||
|
|
||||||
// Its kinda weird this being an Option type.
|
|
||||||
// Rss 2.0 specified that it's optional.
|
|
||||||
// Though the db scema has a requirment of episode uri being Unique && Not Null.
|
|
||||||
// TODO: Restructure
|
|
||||||
let x = item.enclosure().map(|s| url_cleaner(s.url()));
|
let x = item.enclosure().map(|s| url_cleaner(s.url()));
|
||||||
// FIXME: refactor
|
// FIXME: refactor
|
||||||
let uri = if x.is_some() {
|
let uri = if x.is_some() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user