Files
danbooru/app/logical
evazion 964b5efcd3 Rewrite Pixiv small/medium images to full size images.
There are two kinds of thumbnails that need to be rewritten. First case:
new /img-master/ URLs need to be rewritten to /img-original/ URLs like this:

    http://i2.pixiv.net/c/600x600/img-master/img/2014/10/04/03/59/52/46337015_p0_master1200.jpg
    => http://i2.pixiv.net/img-original/img/2014/10/04/03/59/52/46337015_p0.png

This is what `rewrite_new_medium_images` does. In order to do this, it
has to use the Pixiv API to get the correct file extension.

Second case: Old small/medium size URLs need to be rewritten to full
size URLs like this:

    http://i2.pixiv.net/img18/img/evazion/14901720_m.png
    => http://i2.pixiv.net/img18/img/evazion/14901720.png

But when the medium size URL is actually for a manga image, it needs to be
rewritten to the big manga URL instead:

    http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_m.jpg
    => http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_big_p0.jpg

But we can't tell whether it's a manga image from the URL, so we have to
use the manga page count from either the HTML page or the API to
determine whether it's part of a manga gallery.

So in order to make this work, `rewrite_old_small_and_medium_images`
takes an `is_manga` flag. `Sources::Strategies::Pixiv#get` gets the
page count from the HTML and passes the `is_manga` flag on down through
the call chain until `rewrite_old_small_and_medium_images` gets it.

When `rewrite_old_small_and_medium_images` is called from
`Downloads::Strategies::Pixiv#rewrite_thumbnails`, the `is_manga` flag
isn't passed in because we didn't scrape the HTML. This causes
`rewrite_old_small_and_medium_images` to look it up in the API instead.
2014-10-04 12:45:37 -05:00
..
2014-05-23 14:15:44 -04:00
2014-02-28 16:40:11 -08:00
2014-06-17 17:49:41 -04:00
2014-08-25 16:41:27 -07:00
2014-07-18 16:37:35 -07:00
2014-06-24 11:07:39 -07:00
2014-05-23 14:15:45 -04:00
2014-06-01 13:39:19 -04:00
2013-10-21 11:07:15 -07:00
2014-09-24 13:28:56 -04:00
2014-08-12 17:03:16 -07:00
2013-04-09 15:31:49 -04:00
2014-09-24 13:11:54 -04:00
2013-07-25 20:04:29 -04:00
2014-03-14 18:39:31 -07:00
2014-07-23 15:15:47 -07:00
2013-04-14 18:22:25 -07:00
2014-05-29 22:55:35 -04:00
2014-07-22 15:43:28 -07:00
2013-04-16 21:29:33 -07:00