Jordan Petridis
4d77281249
Update deps.
2018-05-19 12:17:55 +03:00
Jordan Petridis
b77a373efa
Opml: remvoe uneccesary to_string invocation.
2018-05-17 15:08:38 +03:00
Jordan Petridis
00e747eb5f
h-gtk: Wire the import_shows button on the hamburger menu to the the opml import.
2018-05-12 22:55:35 +03:00
Jordan Petridis
2d8164cf0a
Clippy: remove useless attribute.
...
Also merge some attributes together.
2018-05-12 15:02:33 +03:00
Jordan Petridis
83f9284b05
Cargo fmt
2018-05-12 13:45:19 +03:00
Jordan Petridis
6e5c70ab71
opml: Change the signature of import_opml function.
...
xml::reader::Error is the only error that can be returned so there
is no need to use the DataError type.
2018-05-12 13:19:14 +03:00
Jordan Petridis
041684b13a
Use impl Trait syntax instead of Trait Objects.
...
Rust v1.26 introduced impl Trait which avoid the heap allocation with Box
and makes the code a bit more ergonomic.
For more see https://blog.rust-lang.org/2018/05/10/Rust-1.26.html
2018-05-11 12:06:31 +03:00
Jordan Petridis
f9b34bbd50
h-data: Initial implementation of an OPML parser and importer.
...
This is not really compiant with the OPML spec and there
does not seem to be an OPML crate sadly. There are edge-cases
that are not handled but will only be addressed if a problem is reported.
2018-05-10 18:17:19 +03:00
Jordan Petridis
f324407c9c
Deny all the warnings when building.
2018-04-30 14:21:34 +03:00
Jordan Petridis
c96b39d597
Fix all the clippy warnings!
2018-04-30 14:13:54 +03:00
Jordan Petridis
d4d89a56e9
Revert "Update deps."
...
This reverts commit f19ad133c6 .
There was dependancy conflitct that was not caught locally due to caching.
2018-04-29 20:15:44 +03:00
Jordan Petridis
f19ad133c6
Update deps.
2018-04-29 19:57:32 +03:00
Jordan Petridis
03bd951848
EpisodeWidget: Handle updating states, withotu having to reload the views.
...
This code is ugly and terrible but it works™. Previsously when a download
would finish it would refresh all the views. Now the if the widget get's
into the Donwloading state, it will setup a callback that will check
periodicly if it's still downloading and update the widget state when
the episode stops downloading.
2018-04-28 14:09:26 +03:00
Jordan Petridis
dc5ff9d809
h-gtk: Take into account the ignored_shows when detemening if podcast table is empty.
...
If you've had one show and pressed unsub, instead of going to
an empty view, it would stay to populated since it the db records
where still there.
2018-04-27 11:21:32 +03:00
Jordan Petridis
d1962ab745
Remove some boilerplate.
2018-04-20 10:15:27 +03:00
Jordan Petridis
37a408e58a
dbquerries: Fix the is_populated() querries.
...
Thanks a lot to the diesel gittrer channel!
2018-04-19 14:45:00 +03:00
Jordan Petridis
09359a8df3
Update deps and bump rss crate.
...
My PR for Channelinto_items() went through and a new rss
release in is already available!
2018-04-19 08:07:02 +03:00
Jordan Petridis
3b5831f317
ShowsView: Do not block while loading ShowChilds.
2018-04-19 07:51:48 +03:00
Jordan Petridis
e4fc7c336e
EpisodeView: Fix empty state.
2018-04-19 05:32:27 +03:00
Jordan Petridis
0e4430bae4
EpisodeView: Initial refactor to make loading non-blocking.
2018-04-19 02:52:58 +03:00
Jordan Petridis
f811a9c8f4
Feed: Split index_channel_items method.
2018-04-18 08:20:26 +03:00
Jordan Petridis
771999c603
h-data: Move some functions from pipeline to feed module.
2018-04-18 07:35:53 +03:00
Jordan Petridis
18820202d7
gitlabci: Add needed ENV vars.
...
abc8fb988f uses an feature of rayon
that's behind a compile time flag.
2018-04-18 07:06:17 +03:00
Jordan Petridis
abc8fb988f
Pipeline: Dispatch feed indexing to the rayon threadpool.
2018-04-18 05:06:02 +03:00
Jordan Petridis
885c525d7b
Pipeline: change the signature of pipeline to accept future::Stream instead of IntoIterator.
2018-04-18 04:05:14 +03:00
Jordan Petridis
418a2f02b2
Pipeline: Add a bad feed test case.
2018-04-18 03:38:06 +03:00
Jordan Petridis
031078284c
Feed: Print an error in stderr before discarding it.
2018-04-18 03:03:05 +03:00
Jordan Petridis
3c7ba8c9d9
Feed: Convert index_channel_items to a Future/Steam impl.
2018-04-18 02:49:21 +03:00
Jordan Petridis
835078a84c
Pipeline: Convert the sources iterator into a Stream and return a Future
...
`futures::stream::iter_ok` is so conviniet, why had None told me
about it before?
2018-04-18 01:40:06 +03:00
Jordan Petridis
049418c2f5
Feed: clean up clunky impl of indexing episodes.
2018-04-17 12:05:10 +03:00
Jordan Petridis
2d291a08fc
h-data: Refactor the Diesel helper traits to use Associated Types.
2018-04-17 01:33:50 +03:00
Jordan Petridis
bc6eeec663
Replace if Let Err(_) with .map_err().ok() patterns.
...
I dislike the indentation and the noise if let adds.
2018-04-16 04:03:44 +03:00
Jordan Petridis
50a508b596
Improve formatting
2018-04-15 02:50:06 +03:00
Jordan Petridis
59c634f626
Source: change the signature of the request constructor
...
We don't really need to return Self.
2018-04-15 02:39:24 +03:00
Jordan Petridis
08ebb9e7d6
pipeline: Make run function generic again.
...
also minor formatting changes.
2018-04-14 08:03:58 +03:00
Jordan Petridis
f5f0a5b873
Remove dead code.
2018-04-14 07:52:55 +03:00
Jordan Petridis
1036176e51
pipeline: Make sure that the futures will be run.
...
Use .then() combinator to override the result and return
Ok(()) even if the task fails. That allows us to use join_all
instead of the custom written collect_futures function.
2018-04-14 07:41:50 +03:00
Jordan Petridis
c6a24e839a
h-data: Implement a tail-recursion loop to follow redirects.
...
Follow http 301 permanent redirects by using a future::loop_fn.
It's kinda funcky, match_status still returns status_codes as erros
and a new DataError Variant had to be added to distiguise when we
should Loop::Continue. This could be cleaned up a lot.
2018-04-14 05:30:29 +03:00
Jordan Petridis
87421ce74d
Cargo fmt
2018-04-13 04:35:50 +03:00
Jordan Petridis
74fb8dc75c
Update deps.
2018-04-12 05:06:33 +03:00
Jordan Petridis
9cb2782ef9
ShowWidget: Initial Lazier evaluation of the widgets.
2018-04-10 16:57:08 +00:00
Jordan Petridis
5cd0a3c451
Fix the things I broke in b74dbb74bb
...
Someone really needs to restrict my access to anything that involves
transistors when I am sleep deprived.
2018-04-10 07:01:55 +03:00
Jordan Petridis
b74dbb74bb
h-data: Remove rel attributes from <a> tags when sanitizing html.
...
They are invalid in `pango` markup so theres no reason they
should are not needed. Also add some paranoid .trim() calls.
It returnes a &str slice so it's cheap.
2018-04-10 06:31:51 +03:00
Jordan Petridis
d332636dd4
Fix the fix that should have fixed the tests.
2018-04-06 19:36:52 +03:00
Jordan Petridis
32654f6cb2
Fix the tests.
2018-04-06 19:18:55 +03:00
Jordan Petridis
14a90e7138
Remove Futures_Cpupool.
...
The performance boost is not good enough to justify the
code complexity it add and the memory overhead of
yeat another threadpool.
We will start refactoring the whole pipeline implemantation
and might transition to either rayon-futures or tokio-runtime.
2018-04-06 18:18:03 +03:00
Jordan Petridis
5cc550c830
NewEpisode: refactor a closure to that returned Option<T> to use .and_then instead.
2018-04-04 16:32:03 +03:00
Jordan Petridis
52cbe67756
NewEpisode: refactor another if else statement and document it.
2018-04-04 16:31:59 +03:00
Jordan Petridis
c910e0af40
NewPodcast: refactor an if else statement and document it.
2018-04-04 16:31:50 +03:00
Jordan Petridis
3d98600126
h-data: Sanitize html during Podcast/Episode parsing.
2018-04-03 19:42:13 +00:00