Commit Graph

125 Commits

Author SHA1 Message Date
Jordan Petridis
c96b39d597
Fix all the clippy warnings! 2018-04-30 14:13:54 +03:00
Jordan Petridis
00d9019f29
Do not pass some things by value when not needed. 2018-04-29 19:27:40 +03:00
Jordan Petridis
8951a6e237
h-gtk: Animate the adjustment of scrolled windows.
Many thanks to Julian Spaber for documenting this.
2018-04-29 19:07:12 +03:00
Ivan Augusto
2f1ea12cfa Update links to new repo 2018-04-19 17:23:46 -03:00
Jordan Petridis
736a993284
h-gtk: Move forgotten test from a68987f257 2018-04-19 08:26:45 +03:00
Jordan Petridis
a68987f257
h-gtk: Move some stuff from utils to settings module. 2018-04-19 08:04:40 +03:00
Jordan Petridis
3b5831f317
ShowsView: Do not block while loading ShowChilds. 2018-04-19 07:51:48 +03:00
Jordan Petridis
5336981154
h-gtk: Change the signature of utils::set_image_from_path to not require a Podcast.
It was only used to call the podcast.id() method. This allows EpisodeViewWidget
to be created whithout the need for a call to the database to get a Podcst
Object for each widget.
2018-04-19 07:15:12 +03:00
Jordan Petridis
7c03266d16
Inline a bunch of stuff. 2018-04-17 09:04:18 +03:00
Jordan Petridis
627f06ea9f
Fix typos. 2018-04-17 08:50:03 +03:00
Jordan Petridis
a0154c5919
lazy_load: Add the ability to execute a callbakc on finish
When iteration of data is finished, None will be returned and
the or_else() block will be executed. Now a callback can be
passed that will be executd when the iteration/loading finishes.
2018-04-17 03:13:01 +03:00
Jordan Petridis
08365c412a
h-gtk:utils Add a more flexible implementation of lazy_load.
lazy_load_full is meant for siturations that you don't need
the constraisn of passing a single container parent and adding
a sigle widget to it.

Reimplemnted lazy_load on top of lazy_load_full.
2018-04-17 02:33:32 +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
3132856efe
h-gtk/utils: Remove expects and unwraps on senders 2018-04-16 01:27:59 +03:00
Jordan Petridis
4db7628eed
h-gtk/utils: Make refresh_feed methods generic over Source. 2018-04-16 01:12:27 +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
572ab86bc4 Document utils::lazy_load. 2018-04-10 16:57:08 +00:00
Jordan Petridis
29cf5940f5 Lazy_load: move to utils module and make it public. 2018-04-10 16:57:08 +00:00
Jordan Petridis
491cd8f01c
cargo fmt 2018-03-30 17:24:38 +03:00
Jordan Petridis
07eadd2364
h-gtk/utils: Improve itunes resolver and add extra test cases. 2018-03-30 16:38:59 +03:00
Jordan Petridis
7086afe73d
h-gtk/utils: More refactor to improve formatting. 2018-03-30 15:33:19 +03:00
Jordan Petridis
f21398357b
h-gtk/utils: Refactor some mutex locks, improve formatting. 2018-03-30 14:39:30 +03:00
Jordan Petridis
c3076e748e
cargo fmt 2018-03-30 10:22:34 +03:00
Jordan Petridis
1595256c86
Use rayon to manage all the threads. 2018-03-30 09:31:25 +03:00
Jordan Petridis
f2444f151c
h-gtk/utils: Re-work format_err! calls and improve formatting 2018-03-29 15:26:44 +03:00
Jordan Petridis
710a3f2552
Use SendCell::try_get instead of SendCell::into_inner 2018-03-29 15:19:13 +03:00
Jordan Petridis
e203815f4f
hammond-gtk/utils.rs: Use a hashset to keep track of cover downloads.
Use a HashSet to check if a download of a cover is already active. If
it is, schedule a callback that will try to set the image from the
cached pixbuf later.
2018-03-29 13:07:46 +03:00
Jordan Petridis
c3658080d3
Comment out a test. 2018-03-29 11:37:31 +03:00
Jordan Petridis
8703470010
h-gtk/utils: Use a threadpool to avoid spawning a million threads 2018-03-29 10:24:02 +03:00
Jordan Petridis
88cc7e6fec
Fix set_image_from_path test 2018-03-29 09:21:49 +03:00
Jordan Petridis
badcbc32c6
Implement async loading of the Show covers. 2018-03-28 22:41:45 +03:00
Jordan Petridis
daa8f15ce9
hammond-gtk::utils: change the signature of get_pixbug_from_path and rename it
Requires a gtk::Image as argument now, it sets the pixbuf to the
img directly instead of returning it.
New name is set_image_from_path.

This is ground work so we can later keep the image reference, and
use it to set the image with a callback.
2018-03-28 21:47:10 +03:00
Jordan Petridis
f7a7510322
Implement the shared HashSet with the ignored Shows ids 2018-03-26 13:25:39 +03:00
Rowan Lewis
f182d441d1 Allow the Copy trait to do the work for us. 2018-03-18 00:29:52 +01:00
Rowan Lewis
afdedc7575 Use crono types instead of unsigned integers for time periods. 2018-03-17 01:10:10 +01:00
Rowan Lewis
69a7a9b180 Renamed the 'auto-refresh' settings to 'refresh-interval' so that they represent the internal behaviour better. 2018-03-16 23:31:12 +01:00
Rowan Lewis
a7540583d6 Connect settings for auto refresh and cleanup. 2018-03-16 23:23:06 +01:00
Jordan Petridis
8a18630ae5
Initial integration of the itunes resolver with the Add button. 2018-03-12 20:49:02 +02:00
Jordan Petridis
b87c331b12
Make the itunes_resolver functions inlined. 2018-03-12 07:28:09 +02:00
Jordan Petridis
9da2414e8b
Initial implementation of an itunes_to_rss url resolver. #49 2018-03-12 06:48:05 +02:00
Jordan Petridis
bb467b7aba
Rustfmt. 2018-03-03 16:45:37 +02:00
Jordan Petridis
ae25dd65bf
Cargo clippy and fmt. 2018-02-19 09:58:47 +00:00
Jordan Petridis
2d33606251
Hammond-gtk: Stack, Content constructors return Results now.
Constructors now proxy underlying errors that migth occur during initialazation.
I think that's about the last unwraps in the main thread.
2018-02-07 03:17:37 +02:00
Jordan Petridis
7ed1cd8b26
hammond-gtk: Change utils::get_pixbuf_from_path function to return a Result. 2018-02-06 20:56:55 +02:00
Jordan Petridis
c6e426cbac
Downloader: Change cache_image function to return Result<T, DownlaoderError> instead of Option<T>. 2018-02-06 20:14:03 +02:00
Jordan Petridis
e8ae0b0251
Thats a hack, a terrible one, but without it the user
would have to manually click refresh if the user that was added
happen to redirect somewhere else.

The problem is in the hammond-data/src/models/source.rs
fn request_constructor. It has to do with futures and lifetimes
and I am not sure how to tackle it yet.
2018-02-03 00:06:02 +02:00
Jordan Petridis
2f062afb07
Clippy suggestions 2018-01-29 19:09:53 +02:00
Jordan Petridis
8c0e3221cb
refresh_feed: remove code duplication. 2018-01-26 19:29:45 +02:00
Jordan Petridis
5e1d1e557f
GtkApplication: Add an action for showing the headerbar_update_indicator. 2018-01-26 19:15:07 +02:00