Commit Graph

56 Commits

Author SHA1 Message Date
Jordan Petridis
075dd1adeb cargo: change email metadata of the crates 2019-03-03 04:59:52 +02:00
Jordan Petridis
c4c6ba9ea4
Update dependencies 2019-03-03 04:46:19 +02:00
Christopher Davis
6c34686d8d
p-data: Implment support for exporting the shows to an OPML file
Close #41
2019-01-27 06:06:46 +02:00
Jordan Petridis
2257688c65
Use rustfmt from the stable rustup channel 2019-01-05 15:11:27 +02:00
Jordan Petridis
9f8ae75691
Remove depricated lints 2018-12-09 03:53:17 +02:00
Jordan Petridis
f9f0dad203
cargo fmt 2018-11-29 14:36:06 +02:00
Jordan Petridis
fdb064ffc8
Update dependancies 2018-11-29 11:57:27 +02:00
Jordan Petridis
0888da2197 Upgrade dependencies 2018-11-18 12:59:02 +00:00
Jordan Petridis
19e0b7e565 Further preparations for Rusto 2018 edition 2018-11-18 12:59:01 +00:00
Jordan Petridis
fd4128c364 Prepare for Rust 2018 edition 2018-11-18 12:59:01 +00:00
Jordan Petridis
32b257ec30
cargo fmt 2018-11-13 15:29:20 +02:00
Jordan Petridis
53bceb89cd
Merge branch 'Ophirr33/podcasts-master'
See !82 for more.
2018-11-07 01:34:06 +02:00
Jordan Petridis
8f6329d71d
podcasts-data: Add per file license annotations 2018-11-04 19:35:35 +02:00
Ty Coghlan
5d71ac584c gnome-podcasts: DRY out From impls in errors
From impls for errors generally just take some error type and map
it into a variant of some podcast error enum. This removes the duplicate
impls by using a pattern macro to make the impls from the type of the
enum, the given error type, and the desired enum variant.
2018-11-03 01:13:35 -04:00
Jordan Petridis
990d830f24
cargo fmt 2018-10-23 13:23:01 +03:00
Jordan Petridis
40186ce155
Update dependancies 2018-10-06 11:29:52 +03:00
Jordan Petridis
32bd2a89a3
Stacks: Check if there episodes insteads of shows
If you added a Feed where a Show exists but it had no episodes
entries, the stack would end up in a populated state, but the
HomeView would be blank without widgets.

This changes it so the stack state depends upon the episodes
table being populated instead of the show. The downside
is that if your only feed is one without episodes you can
no longer navigate and interact with it.
2018-10-06 10:22:24 +03:00
Jordan Petridis
df302ad517
Pipeline: Do not terminate the stream upon errors
Stream::for_each terminated the stream upon the first error. This
was causing feeds to not update if any one returned a non-200ish
result. To work around this, we create a succesfull result for
every entry regardless at the end.

While we are at it, aslo switch from FuturesOrdered stream
to FuturesUnordered. There is no reason to use Ordered, this was
a typo initially.
2018-10-04 18:48:11 +03:00
Jordan Petridis
7e3fecc44a
Source: Refactor the clear_etags method api 2018-10-04 16:46:04 +03:00
Jordan Petridis
0887789f5e
Pipeline: Complete the move to Tokio Runtime 2018-09-29 13:35:45 +03:00
Jordan Petridis
62029f6164
Pipeline: Minor refactor
Use the proper Stream API to return a future to run on the
executor. Previously I was using a workaround to convert the
Stream into a future and run it to completion in the Executor,
since I was not aware of a better API.
2018-09-29 12:03:00 +03:00
Jordan Petridis
8d44649a1e
Update dependancies 2018-09-29 09:54:06 +03:00
Christopher Davis
7181c46ed5
podcasts-data: Upgrade hyper to 12.X
This also allows us to bump hyper_tls and native_tls, bringing
support for openssl 1.1.
2018-09-29 09:54:06 +03:00
Jordan Petridis
de1c8485ae
Fix rustc warnings
New warnings were introduced with rustc 1.29.0

podcasts-data/src/lib.rs: this one can be removed once diesel is
upgraded.
https://github.com/diesel-rs/diesel/issues/1785#issuecomment-422577018

podcasts-gtk/src/i18n.rs: This is just a deprication warning
2018-09-22 04:47:24 +03:00
Jordan Petridis
208f0c248d
Update rest of the dependancies 2018-09-13 15:47:40 +03:00
Jordan Petridis
b40c12efbd
Pipeline: Avoid spamming stderr when not needed
This commit add a new DataError Variant for feeds that return 304.
Its expected behaviror and the current API of Source::into_feed
is kinda limiting the return type to make it easier to handle.

Up till now 304 was returning an Error to early return. Ideally
Source::into_feed will return a Multi variant Result Enum.

example:

enum FeedResult {
    Ok(Success(feed)),
    Ok(NotModified),
    Err(err),
}

Hopefully in a refactor in the near Future™

Till then we will just have to match and ignore
DataError::FeedNotModified.
2018-09-08 20:17:47 +03:00
Jordan Petridis
3c5ddad133
DataError: Improve the FeedRedirect variant 2018-09-08 20:17:47 +03:00
Jordan Petridis
1ca4cb40dd
Pipeline: clear the imports of fututres 2018-09-08 20:17:47 +03:00
Jordan Petridis
e633fa41ac
Pipeline: Minor formatting improvment 2018-09-08 20:17:47 +03:00
Jordan Petridis
dac303e33b
Pipeline: Use a custom tokio threadpool
This reverts commit e64883eecb
and 40dd2d6923

Seems like core.run() returns once its done even if there
are still tasks in the Runtime underneath. A way to solve that
would be to call the shutdown_on_idle method.

We need ownership of the threadpool in order to invoke
`shutdown_on_idle` method but core.runtime only returns a
referrence so we need to create our own threadpool.
2018-09-08 20:17:46 +03:00
Jordan Petridis
a991d9f512
DataError: Remove unused error variant
This was added due to Threadpool::spawn returning errors, but its
no longer used.
2018-09-08 20:17:46 +03:00
Jordan Petridis
674b3b54dc
Pipeline: reuse the prexisting runtime executor
Instead of creating our own threadpool, we should reuse the executor
of the tokio::runtime::Runtime that backs the tokio::reactor::Core.
2018-09-08 20:17:46 +03:00
Jordan Petridis
09948845ca
Pipeline: Remove use of clone! macro 2018-09-08 20:17:46 +03:00
Jordan Petridis
0b8a0695f7
Pipeline: Use tokio threadpool to index feeds 2018-09-08 20:17:46 +03:00
Jordan Petridis
a7c95d5718
Pipeline: Remove dependancy on rayon_futures
This requires a RUSTFLAG to be set before hand for rayon to build.
This brakes a lot of tools like rls and clippy by default and
require special configs for itnegration.

Additionally, rayon_futures is still 0.1 and not much work seem
to have gone into it. Ideally it should be replased with the tokio
runtime/threadpool.
2018-09-08 20:17:46 +03:00
Jordan Petridis
8a05597e52
Feed: Remove another unnecessary wrapper 2018-09-08 20:17:45 +03:00
Jordan Petridis
145d45f800
Feed: Remove unnecessary function wrapper 2018-09-08 20:17:45 +03:00
Jordan Petridis
3f509f44a1
Update dependancies. 2018-08-30 20:45:53 +03:00
Jordan Petridis
aa1d0161d3
cargo fmt 2018-08-27 21:08:29 +03:00
Jordan Petridis
79ac3b9700
Update dependancies 2018-08-18 18:33:26 +03:00
Jordan Petridis
7a3178896b
Remove criterion
Haven't been able to use it effectivly with futures. Maybe will
revisit it again at a later time. For now it just adds extra
build time.
2018-08-18 18:02:28 +03:00
Jordan Petridis
89b99614a0
Refactor the tests to use ? operator
As of ructc 1.27 #[test] can return errors. This improves a great
deal the ergonomics.
2018-08-18 17:02:31 +03:00
Jordan Petridis
3abe0803d6
Source: Remove reduntant save() call
Source::clear_etags does a save already, so it's not needed to call
it twice.
2018-08-17 09:57:49 +03:00
Jordan Petridis
489e8aa4b3
Source: Improve http redirections handling
We should follow all redirects, and update the Source uri for
301, 302 and 308 codes.

Closes #85
2018-08-17 07:09:12 +03:00
Jordan Petridis
49aff9f22e
Source: Only save Etag headers upon succesful requests
Additionally clear the Etags if the returned code is not 200 or 304.
Just to be extra safe. This is not as clean as it should, as this is
a temporary workaround until the API is reworked.

Related to #64
2018-08-17 05:36:34 +03:00
Jordan Petridis
cc1a5783fd
App: Do not update the db if its empty
If the source table is empty skipp the database refresh.
2018-08-14 15:19:31 +03:00
Jordan Petridis
03754c56c6
Fix the test-suite 2018-08-14 13:40:37 +03:00
Jordan Petridis
471f6ff93b
Source: Remove ignore_etags option
This is never used anywhere else apart from the testsuite. Instead
of ignoring etags we should instead not save them if the feed does
not return 200 or 304. See #64.
2018-08-14 13:40:33 +03:00
Jordan Petridis
c53ad56a6d
Remove TODOs and FIXMEs
They are either no longer relevant or just forgotten
2018-08-14 13:40:28 +03:00
Jordan Petridis
f6c7731377
Fix Rust 2018 edition warnings 2018-08-05 11:24:20 +03:00