Commit Graph

157 Commits

Author SHA1 Message Date
Jordan Petridis
f9096e5fac
Pipeline: Print the error right away instead of waiting till all futures complete. 2018-01-23 18:18:56 +02:00
Jordan Petridis
e74a2df27f
Source: On Http 301 response, update Source.uri . 2018-01-23 16:43:02 +02:00
Jordan Petridis
050fe9c52b
Pipeline: offload more stuff to the threadpool. 2018-01-23 11:43:37 +02:00
Jordan Petridis
f7f6087d70
NewPodcast: On update unit test assert .id and .source_id fields stay the same. 2018-01-22 21:09:06 +02:00
Jordan Petridis
ea75d50053
NewEpisode: Add insert unit test. 2018-01-22 17:25:23 +02:00
Jordan Petridis
44d7a4e222
NewEpisodeMinimal: Add unit test for into_new_episode method. 2018-01-22 15:49:58 +02:00
Jordan Petridis
2d6f34fa4d
NewEpisode: Clean up tests a bit. 2018-01-22 15:34:57 +02:00
Jordan Petridis
66e816fc5f
Upgrade Diesel to 1.1 2018-01-22 11:22:01 +02:00
Jordan Petridis
843feabf25
NewEpisode: Move the parsing tests, delete old xml files. 2018-01-21 13:35:35 +02:00
Jordan Petridis
937bd61d5e
NewPodcast: Add unit test for the to_podcast() method. 2018-01-21 12:17:47 +02:00
Jordan Petridis
4ee5888b7f
NewPodcast: Rename into_podcast method -> to_podcast since it now does not take owenership. 2018-01-21 11:04:15 +02:00
Jordan Petridis
73eeb1b545
NewPodcast: Add NewPodcast.index unit test. 2018-01-21 10:04:53 +02:00
Jordan Petridis
16bbfb5478
NewPodcast: Add (lackign) NewPodcast.update unit test. 2018-01-21 09:35:48 +02:00
Jordan Petridis
410657c98b
NewPodcast: Remove the boilerplate on the unit tests. 2018-01-21 08:57:50 +02:00
Jordan Petridis
1625f773c2
hammond-data: Fix PartialEq implementations, add NewPodcast.insert unit test. 2018-01-21 08:39:50 +02:00
Jordan Petridis
da8c3a7827
Implement PartialEq accross Insertable and Queryable diesel models. 2018-01-20 19:09:25 +02:00
Jordan Petridis
6c9e0984a5
Migrate podcast tests to use the internet archive snapshots. 2018-01-20 18:02:07 +02:00
Jordan Petridis
df17a10014
Source: refactor into_feed test. 2018-01-20 16:43:32 +02:00
Jordan Petridis
ef52a026bc
Feed: Add Builder pattern. 2018-01-20 08:46:05 +02:00
Jordan Petridis
7d9781052f
hammond-data: Rework the modules privacy. 2018-01-20 07:28:30 +02:00
Jordan Petridis
1606ceaadb
Source: split response_to_channel into more futures. 2018-01-19 16:29:50 +02:00
Jordan Petridis
46b6c0d27e
hammond-data: Remove leftover synchronous code. 2018-01-19 15:41:37 +02:00
Jordan Petridis
e6b0cfccb5
Apply clippy suggestions. 2018-01-19 10:32:25 +02:00
Jordan Petridis
5c5faafc72
Source: Move around code and change some methods signature.
request_constructor is now a Source method.
update_etags now takes &mut self instead of mut self.
update_etags now uses source setters methods instead of raw fields.
changed the naming of into_feed to to_feed according to rust convention.
2018-01-19 07:51:55 +02:00
Jordan Petridis
9dc555cad7
Feed: Add an index_async implementation. 2018-01-18 18:57:44 +02:00
Jordan Petridis
1394366f91
hammond-data: Delete some dead code. 2018-01-18 17:04:57 +02:00
Jordan Petridis
6abf2535b0
hammond_data: Make index a trait that requires Insert + Update. 2018-01-18 16:33:07 +02:00
Jordan Petridis
93372a30d0
1.21 Gigawatts. Remove non-future indexing loop.
Tried to have a seperate futures loop but it's too confusign having
too write a Trait2, functon2, etc version of everything and keep it together.

Futures are functional sort of, so the synchronous versioun can be removed.
It still needs a ton of work though to be ready, or even get near the perf
of of the sync+rayon version.
2018-01-18 11:38:24 +02:00
Jordan Petridis
5d88998180
hammond_data: Add an EpisodeMinimal Diesel model. 2018-01-17 10:21:16 +02:00
Jordan Petridis
574cfae5c6
rustfmt: enable reorder imports. 2018-01-17 08:57:02 +02:00
Jordan Petridis
e707087e72
hammond_data: Split models::queriables into multiple modules. 2018-01-17 08:45:14 +02:00
Jordan Petridis
3a6f6d8931
hammond_data: Split models::insertables into multiple modules. 2018-01-17 08:27:39 +02:00
Jordan Petridis
3766db2b14
hammond_data: Move parse_podcast into a NewEpisode method. 2018-01-17 07:31:24 +02:00
Jordan Petridis
8174fe0bac
hammond_data: Move parse_episode from parser into a NewEpisode method. 2018-01-17 07:16:59 +02:00
Jordan Petridis
f64779f70a
Parser: Add NewEpisodeMinimal struct.
Parsing whole episodes can be expensive and we only need
a subset to determine if it should be indexed/updated or ignored.
2018-01-16 18:33:32 +02:00
Jordan Petridis
b3460b15a2
hammond_data::Feed: add parse_podcast_future method. 2018-01-16 13:44:33 +02:00
Jordan Petridis
7f78e87551
hammond_data::Feed: Remove unused parts. 2018-01-16 12:35:08 +02:00
Jordan Petridis
3358fcd0b3
hammond_data::Feed: general cleanup of no longer needed stuff. 2018-01-15 11:03:40 +02:00
Jordan Petridis
10345ffda7
Pipeline: add matching on status code. 2018-01-15 10:16:01 +02:00
Jordan Petridis
2f7a22355f
Minor cleanup of the mess. 2018-01-14 08:27:50 +02:00
Jordan Petridis
1031315cdd
Getting somewhere? 2018-01-14 06:37:47 +02:00
Jordan Petridis
a5fd79e220
I hate futures error handling. 2018-01-13 14:47:38 +02:00
Jordan Petridis
e4d77a6ba4
Cleanup the id() method mess of the diesel models. 2018-01-13 07:46:56 +02:00
Jordan Petridis
6517956987
This works somehow... 2018-01-13 07:09:59 +02:00
Jordan Petridis
ee9cede921
hammond_data: Remove Source dependancy from Feed struct. 2018-01-13 06:08:51 +02:00
Jordan Petridis
1dd25f91fd
Minor cleanup 2018-01-13 05:47:23 +02:00
Jordan Petridis
8e367b7e86
Dont ask me how this is working. 2018-01-12 08:50:16 +02:00
Jordan Petridis
955845110b
Merge branch 'master' into 33-downloader-re-work 2018-01-09 12:06:38 +02:00
Jordan Petridis
ea70addbc6
Removed some unwrap()s. 2018-01-09 09:21:07 +02:00
Jordan Petridis
345d4b3865
Check more http status codes when parsing feeds. 2018-01-08 02:41:37 +02:00
Jordan Petridis
37e9b6fbf0
'How hard could it be' 2018-01-02 07:23:53 +02:00
Jordan Petridis
e727734443
DB Schema: Remove episode.published_date column. 2017-12-30 22:23:10 +02:00
Jordan Petridis
5730e71e2a
Clear TODO and FIXME that are no longer releavant. 2017-12-30 20:54:23 +02:00
Jordan Petridis
036292284d
hammond-data: Do not clean source url's cause some feeds use queries as identifiers for some reason. 2017-12-29 20:21:36 +02:00
Jordan Petridis
ca06a16bd9
Closes #2. Kudo to @jwykeham for the fix!. 2017-12-29 02:45:02 +02:00
Jordan Petridis
fde4bedce6
hammond-data::parser: Refactor Podcast tests. 2017-12-25 23:29:42 +02:00
Jordan Petridis
4512790f2d
hammond-data: Add duration column to the episode table. 2017-12-22 17:30:07 +02:00
Jordan Petridis
b820ee4db7
hammond-data::parser : Do not clean image urls cause feeds put redirects for uri for some reason. 2017-12-22 14:51:57 +02:00
Jordan Petridis
e416bca963
Implemented a pixbuf cache mechanism.
Since gdk_pixbuf::Pixbuf is refference counted and every episode,
use the cover of the Podcast Feed/Show, We can only create a Pixbuf
cover per show and pass around the Rc pointer.

GObjects do not implement Send trait, so SendCell is a way around that.
Also lazy_static requires Sync trait, so that's what the mutexes are.
2017-12-21 17:36:07 +02:00
Jordan Petridis
db59bed69d
hammond-data::utils: Modified EpisodeCleaner Diesel model to also be used with played_cleaner. 2017-12-20 19:18:20 +02:00
Jordan Petridis
3c24b9f9d9
hammond-data::utils: Added new Diesel model for the download checker. 2017-12-20 19:00:14 +02:00
Jordan Petridis
2e06205eda
Define a new Diesel Model for PodcastCover querries.
Define new Diesel Model and impl From<Podcast> trait,
Change the signature of downloader::cache_image function,
Change and merge hammond-gtk::utils::get_pixbuf_from_path functions.
2017-12-20 18:19:31 +02:00
Jordan Petridis
914cad72f5
EpisodesView: Custom Diesel model not really necessary. 2017-12-19 20:45:40 +02:00
Jordan Petridis
895591f628
EpisodesView: Use show cover image. 2017-12-19 13:19:38 +02:00
Jordan Petridis
f602e8c36d
EpisodesView: Create a DieselModel for EpisodeViewWidget. 2017-12-19 11:04:44 +02:00
Jordan Petridis
afdb79b712
Set the progress bar into activity mode. 2017-12-14 13:38:18 +02:00
Jordan Petridis
8fe6b526a5
Add a new Diesel Model for the EpisodeWidget. 2017-12-14 12:01:35 +02:00
Jordan Petridis
d8281c70a5
Better naming of a dbquery function. 2017-12-10 06:11:03 +02:00
Jordan Petridis
bc57c33491
Change episode table schema. 2017-12-09 17:38:46 +02:00
Jordan Petridis
b528c48e3b
Run rustfmt. 2017-12-09 05:57:16 +02:00
Jordan Petridis
8e6cc4d2f2
Remove custom builders in favor of derive_builder crate. 2017-12-05 09:10:02 +02:00
Jordan Petridis
76f9f36609
Document Source Model. 2017-11-28 09:01:38 +02:00
Jordan Petridis
4d669ef297
Document Podcast Model. 2017-11-28 08:40:27 +02:00
Jordan Petridis
3707b70b41
Document Episode Model. 2017-11-28 08:25:04 +02:00
Jordan Petridis
cb65782829
Extended the NewModel builder and added a bunch of unit tests. 2017-11-27 04:32:21 +02:00
Jordan Petridis
ee4f08c5cf
Implemented a BuildPattern for NewModels. Swiched stuff to pub(crate).
Added a Constructor for NewModels in order to make their fields private.
Also added getter methods that are mainly used in Unit tests.
2017-11-26 23:30:56 +02:00
Jordan Petridis
9d0df9de46
Tweak cargo privacy settings. 2017-11-26 06:21:14 +02:00
Jordan Petridis
6336f7cac1
Moved update funtions into a Trait and impl for NewModels. 2017-11-26 00:56:38 +02:00
Jordan Petridis
39dff5e27a
Moved insert functions into an Insert trait and implemented it for each NewModel. 2017-11-26 00:40:03 +02:00
Jordan Petridis
ce3a76aee1
Update episode rows instead of replacing them. 2017-11-26 00:13:51 +02:00
Jordan Petridis
2f801043c1
In place update a podcast row instead of replace. 2017-11-25 18:22:56 +02:00
Jordan Petridis
f83f894e44
Replaced pool.get().unwrap() statements with get()?. 2017-11-25 03:29:06 +02:00
Jordan Petridis
62da8bbb52
Use source_id as the unique identifieble field for the podcast table. 2017-11-25 01:56:10 +02:00
Jordan Petridis
4a195eb1b7
Moved set_played_now into a method of the Episode model. 2017-11-24 19:48:20 +02:00
Jordan Petridis
5570fdd118
Switched to using r2d2 instead of a databaseConnection object. 2017-11-23 21:09:50 +02:00
Jordan Petridis
aa7c493e81
hammond-data/src/feed.rs api changes. 2017-11-23 18:48:41 +02:00
Jordan Petridis
a58671ea9a
Moved database related things into their own module. 2017-11-22 21:54:09 +02:00
Jordan Petridis
3bcb23b39a
Redefine NewModels to hold Option<String> instead of Option<&str>. 2017-11-22 09:53:52 +02:00
Jordan Petridis
31328355b1
Methods renaming, Api changes. 2017-11-22 06:25:34 +02:00
Jordan Petridis
9bc6df2cba
Made Disel NewModels private. 2017-11-22 05:50:25 +02:00
Jordan Petridis
7be0b5bbf8
Added a url cleanr. Closes #4. 2017-11-20 22:06:29 +02:00
Jordan Petridis
5890fe2bb4
Moved all diesel queries into hammond-data/src/dbquerries.rs module. 2017-11-20 20:05:00 +02:00
Jordan Petridis
0ce4107be4
Revert back to using an Arc<Mutex<Connection>> instead of the pool. 2017-11-20 18:09:53 +02:00
Jordan Petridis
ce29602431
I hate everything. 2017-11-20 16:57:27 +02:00
Jordan Petridis
beaeeffba8
Refactored dbquerries.
Refactored so dbquerries.rs module *should* be the only piece of code
that interacts with a Database connection. Insert stuff will be moved too.
2017-11-19 23:08:36 +02:00
Jordan Petridis
47b32ac000
Removed the Database type alias. 2017-11-19 22:39:51 +02:00
Jordan Petridis
55442529a8
Initial switch to using r2d2. 2017-11-19 22:06:10 +02:00
Jordan Petridis
563f249a48
Reverted index_channel items to the synchronous version.
Using a transaction yields ~1/3 better performance as of now.
2017-11-18 19:57:50 +02:00
Jordan Petridis
494761beaf
Removed id function from diesel models.
It's automaticly declared upon derive identifiable,
And there's no need to overwrite it.
2017-11-18 15:23:40 +02:00
Jordan Petridis
6894f33895
Renamed hammond-data/src/index_feeds.rs module into feed.rs. 2017-11-18 14:32:58 +02:00