Commit graph

290 commits

Author SHA1 Message Date
eab14e31fd waaay speed up Pet#translate_items
A few key changes:
  * Don't reload the whole pet 8 times!! Sooo many bad things
    happen, including redundant lookups of everything else and
    too many item saves and reindexes. Instead, fetch the item
    data, apply it to the items, and then save the items (once
    each!)
  * Updated my branch of globalize3 to be even better at avoiding
    redundant queries when saving. Woo.
  * Last realization: wrapping all the item saves in a single
    transaction works wonders. COMMIT seems to have high overhead,
    so doing only one took it from 50ms * 10 or whatever to 60ms.
    Good stuff.
2013-01-28 15:18:11 -06:00
482b1a155d ugh, fine, save the pets sequentially 2013-01-28 03:02:20 -06:00
206811a2fb oops, deal with missing item fields better 2013-01-28 03:01:25 -06:00
0b32e8ba59 cut down on pets#load zone queries 2013-01-28 02:19:37 -06:00
a39110884d cut down on pets#load queries 2013-01-28 02:10:25 -06:00
6c3ff09f5d make en-MEEP translatable - because sorting by translations doesnt work well with fallbacks 2013-01-27 20:43:08 -06:00
8d72bf6353 temporarily disable user-filters in item search 2013-01-27 01:45:18 -06:00
eaf875c6c7 zone, species, color alphabetical by the current locale
We were joining to the translations table to sort records
alphabetically, but then it sorted by *all* of the translations in
some strange way. Now use with_translations to restrict the join
to the current locale.
2013-01-27 00:25:52 -06:00
361b5df256 translate zones 2013-01-26 09:54:29 -06:00
e86bcfaf54 improve globalized search queries: normalize input, fallbacks, etc 2013-01-26 09:52:58 -06:00
2798ebbd5c fix pb filter for other locales 2013-01-26 09:52:21 -06:00
8bb553701a remove N+1 queries in contributions#index 2013-01-25 15:23:48 -06:00
573e8a6459 use I18n.with_locale wherever possible, since it catches errors properly
In particular, pet#load was handling locale-switching itself, but wasn't
switching back to original locale on error. We could've used a rescue
block, but, when I18n.with_locale is so cool, may as well use it fully.
2013-01-25 15:09:56 -06:00
4e0ce6c20b bugfix: zone-not-found raises error again 2013-01-25 11:15:54 -06:00
e6d9e5ee75 stop removing "item" from zone plain labels: background vs. backgrounditem 2013-01-25 10:47:47 -06:00
d0dffd6cff fix ClosetHanger.set_quantity to not call destroy on a new hanger; it confuses flex 2013-01-25 10:44:15 -06:00
7f18fe12c1 user:owns, user:wants queries 2013-01-25 10:35:35 -06:00
dd30fbe0d7 move from with_translations to includes(:translations), since we dont usually care about requiring 2013-01-24 18:26:00 -06:00
b2822d901b fix n+1 query for translations on items#index 2013-01-24 18:26:00 -06:00
26ac3782ec move zones to database 2013-01-24 18:26:00 -06:00
ce4e2fd53c move species to database 2013-01-24 18:25:59 -06:00
965465ca51 move species to database 2013-01-24 18:25:59 -06:00
94ecc6f02d remove old item search interface 2013-01-24 18:24:35 -06:00
cded361f73 update item search to original name-matching behavior
We originally had a regression on name-matching, where, among
other issues, `straw hat` returned items containing both "straw"
and "hat", which isn't really helpful behavior since we're sorting
alphabetically. Now, `straw hat` behaves as expected.

Additionally, "phrases like these" behave as expected, too.
2013-01-24 18:24:35 -06:00
04f29c8611 allow non-item zones in queries (mainly for restricts filters) 2013-01-24 18:24:35 -06:00
66e0ba28d7 species/zone conditions now render properly, instead of raising parse error from elastic 2013-01-24 18:24:35 -06:00
6e09b8bc10 globalized search first draft
Confirmed features:
    * Output (retrieval, sorting, etc.)
    * Name (positive and negative, but new behavior)
    * Flags (positive and negative)

Planned features:
    * users:owns, user:wants

Known issues:
    * Sets are broken
        * Don't render properly
        * Shouldn't actually be done as joined sets, anyway, since
          we actually want (set1_zone1 OR set1_zone2) AND
          (set2_zone1 OR set2_zone2), which will require breaking
          it into multiple terms queries.
    * Name has regressed: ignores phrases, doesn't require *all*
      words. While we're breaking sets into multiple queries,
      maybe we'll do something similar for name. In fact, we
      really kinda have to if we're gonna keep sorting by name,
      since "straw hat" returns all hats. Eww.
2013-01-24 18:24:35 -06:00
c9ae7155b1 locale metadata, including hidden locales for item loading and selection 2013-01-24 18:24:34 -06:00
ef2423e87f globalize3 for items 2013-01-24 18:24:34 -06:00
29ed401238 load pet by locale, prepare needed translations 2013-01-24 18:24:34 -06:00
9c8f7f498f basic translation infrastructure for items - search is still english-only, and probably will have to be replaced with a legit search engine 2013-01-24 18:24:34 -06:00
d79c225c1e apply globalize3 to items 2013-01-24 18:24:34 -06:00
b213f6d0ba i18n for closet_hangers#index, closet_lists#edit, closet_lists#new, and maybe some more closet-related things - this was a biggie 2013-01-24 18:23:19 -06:00
c32425bc14 i18n for neopets_pages#new 2013-01-24 18:23:19 -06:00
ac0490dc1d i18n for items#show (including javascripts/items/show.js) 2013-01-24 18:23:19 -06:00
5e89e2b947 i18n for items#index (and layouts#items) 2013-01-24 18:23:18 -06:00
132a49d30b i18n for outfits#new (and layouts#application), including caching 2013-01-24 18:23:18 -06:00
bfd825d98e attempt to fix new species_support_ids format. sigh. 2013-01-23 00:25:09 -06:00
9701221035 wardrobe now considers item.species_support_ids when deciding compatibility
For example, the Meerca Maid Tray is a foreground item, so the SWF is marked
as compatible with all body types, but the item itself is clearly marked as
Meercas-only. items#show reflected this properly, but the swf_assets#index
call that the wardrobe uses ignored item.species_support_ids.

So, /bodies/:body_id/swf_assets.json?item_ids[]=... was deprecated in favor
of /pet_types/:pet_type_id/items/swf_assets.json?item_ids=[]..., which is
much like the former route but, before loading assets, also loads the pet
type and items, then filters the items by compatibility, then only loads
assets for the compatible items.
2013-01-02 23:15:32 -05:00
339a730779 timeout on background jobs 2012-11-04 12:01:03 -06:00
f56b544963 brought-to-you-by on items#show lists contributors 2012-10-24 22:09:05 -05:00
671641cc16 a more forgiving "type" search filter 2012-10-08 21:20:18 -05:00
775ef7fa51 finally fix encased in ice - woo! 2012-10-05 20:56:52 -05:00
9fcc1b244a bug fix: pet importer no longer chokes when two pets wear the same item 2012-10-01 13:22:17 -05:00
ddec043209 support pea chia cape in infinite closet 2012-09-29 12:40:55 -05:00
7dfc6d81a2 add timeout to pet load 2012-08-11 18:47:25 -04:00
412c401c5f better cache items#show 2012-08-10 00:02:11 -04:00
99669b8e4e cache homepage latest contribution 2012-08-09 22:59:35 -04:00
f6d34841ec cache newest items on homepage and items#index 2012-08-09 22:35:30 -04:00
1e3938eea9 improve closet performance by caching item link 2012-08-09 19:34:56 -04:00
4a69772cd2 remove N+1 queries on current user outfits page 2012-08-09 18:32:33 -04:00
72237f225c modeling hub 2012-08-06 21:15:31 -04:00
2435c7f7e9 oh shoot, properly unlink outfit tempfiles now... 2012-08-01 21:30:22 -04:00
82c4a8d4b4 on creating outfit image, skip broken images instead of throwing exception 2012-07-31 12:05:49 -04:00
2b88ce9b4b use openneo-uploads bucket 2012-07-31 11:42:27 -04:00
ec40e6ae67 new outfit image filename: preview instead of thumb, one more partition level 2012-07-31 10:41:13 -04:00
05acae3cb8 retroactively enqueue outfit images 2012-07-31 10:20:37 -04:00
42827362b6 optimize outfit image generation - 4x speed boost on my box
Use the ImageMagick flatten command to generate the output all at
once instead of compositing each layer individually, and download
the layers in parallel. On my box, saving roopal27 five times took
a total of 30 seconds before, whereas now it takes 7 seconds. I
expect it to be even better on the production box, where latency
is even lower.
2012-07-27 23:07:20 -04:00
374c7e6147 Sharing now fully supports saved outfits, not just shared ones 2012-07-26 23:47:22 -04:00
7b5856ebf9 basic sharing
Sharing pane works, everything is great for guests. Logged in
users are on the way, since right now Share Outfit re-saves
anonymously rather than showing sharing data for the existing
outfit.
2012-07-17 12:15:04 -04:00
cf2546d832 basic image thumbnails 2012-07-16 16:47:28 -04:00
7c015e2d88 carrierwave for asset swfs 2012-07-16 16:45:26 -04:00
5a5b5fffc7 outfit default url 2012-07-16 16:45:26 -04:00
220aca9311 outfit thumbnails initial commit 2012-07-16 16:45:26 -04:00
22cfff66e9 outfits now know their own visible assets 2012-07-16 16:40:07 -04:00
644fac99da improve gender/mood sorting using new labels 2012-06-20 16:10:53 -04:00
6cdf1567f8 fix error loading lookups when given pet name has trailing spaces 2012-06-05 13:28:59 -04:00
b25b6e55b3 ignore errors loading gender/mood data
For example, the site was throwing a 500 error when loading pets
belonging to frozen users. Instead, we'll now rescue that
Neopets::User::AccountDisabledError and ignore it, since it's not
*vital* that we load gender/mood data from this pet; we can still
proceed to load its customization data without it.
2012-06-05 13:02:49 -04:00
c2c6a800f2 track pet state gender/mood 2012-05-23 20:00:38 -04:00
4e7e98beca use Neopets::User for username-based closet imports 2012-05-21 12:48:19 -04:00
f3d64840d6 filter lists on petpage export 2012-04-08 15:59:51 -05:00
44156c5b21 can now have the same item in more than one list 2012-03-23 16:25:10 -05:00
7795119a8c fix gender/emotion states with corridor of chance effects sorting to the front
So it turns out this was just one of those things I forgot to fix
the big database restructure came along: we were comparing
swf_asset.remote_id against parents_swf_assets.swf_asset_id, which
are two different identifiers entirely. Now using swf_asset.id,
so fixed :)
2012-03-15 17:01:21 -05:00
baae0c9954 fix bug where some pet states would also show many items on top of them
At first I thought this was an error in the data migration process when moving SWF assets
to having their own unique IDs, but then realized that the query for a pet state's SWFs
didn't include the (parent_type = 'Item') condition. Oops. Turns out, I only connected the
items to parent_swf_asset_relationships polymorphically. Pet states were still doing it the
hackish way. Set the pet states to use the lovely polymorphic relationship and we're good
to go.
2012-02-21 13:25:11 -06:00
4d314417e2 fix parent-swf-asset-relationship destruction bug
After changing the database structure, we lost the feature where, once we discover
new assets for an item for a given body ID, we disconnect previously connected
assets. This commit reinstates that feature.
2012-01-26 13:51:30 -06:00
4566bca906 another attempt to fix pet state rel autosave 2012-01-13 16:11:44 -06:00
bcb5644b12 stop autosaving biology swf rels 2012-01-13 16:02:14 -06:00
ec3088fdec ensure that pet state is saved before trying to save its assets 2012-01-13 15:56:31 -06:00
171d691a98 fix nc mall spider for remote ID 2012-01-13 15:27:30 -06:00
ec9e997ac5 fix user:owns id ambiguity 2012-01-13 15:20:47 -06:00
9c0c7b78cf another oops, better fix 2012-01-12 22:02:12 -06:00
c2c0fe92e8 oops, be consistent in using remote ID when loading pets 2012-01-12 21:47:17 -06:00
696b2aedaf give SWFs real, unique ID numbers
Lots of scary bugs were being caused by the fact that the possibly-duplicate Neopets ID
was being treated as an SWF's real primary key, meaning that a save meant for object swf
number 123 could be saved to biology swf number 123. Which is awful.

This update gives SWFs their own unique internal ID numbers. All external lookups still use
the remote ID and the type, meaning that the client side remains totally unchanged (phew).
However, all database relationships with SWFs use the new ID numbers, making everything
cleaner. Yay.

There are probably a few places where it would be appropriate to optimize certain lookups
that still depend on remote ID and type. Whatever. Today's goal was to remove crazy
glitches that have been floating around like mad. And I think that goal has been met.
2012-01-12 17:17:59 -06:00
cc23f7435b automatically rezone bio 2011-10-31 16:22:24 -05:00
f7723ac1c8 automatically rezone items 2011-10-23 14:09:53 -05:00
285c7858c0 app can now load environment even if schema not yet loaded 2011-09-06 11:15:09 -05:00
b50b9d237d allow broken image resubmits after 1hr 2011-08-07 20:43:42 -04:00
7358aae680 report broken images 2011-08-07 18:23:44 -04:00
4e74589118 privacy bug: would show hangers even in private lists as Trading if unlisted hangers were marked Trading 2011-08-06 23:15:32 -04:00
a4feee89b5 allow the new items migration to run. sigh 2011-08-04 10:04:15 -04:00
d99a1ad792 newest items 2011-08-04 10:01:44 -04:00
b939c7fce6 Merge branch 'closet' 2011-08-03 11:35:07 -04:00
2398f34071 import items from pets 2011-08-03 11:35:06 -04:00
c2648c5343 Merge branch 'closet' 2011-08-03 10:33:21 -04:00
63bc0067c0 user#assign_closeted_to_items! now assigns when there are duplicates 2011-08-03 10:18:03 -04:00
2dd6586ea6 Merge branch 'closet' 2011-08-02 22:42:59 -04:00
513711bf60 import sdb as well as closet 2011-08-02 22:42:56 -04:00
fed5ccb7fb Merge branch 'closet' 2011-08-01 00:00:40 -04:00
2f0b0743e8 throw a search error on user:owns when user owns no items 2011-07-31 23:50:33 -04:00
f6ed50a62f Merge branch 'closet' 2011-07-31 23:05:26 -04:00