Commit graph

26 commits

Author SHA1 Message Date
Laurent Monin
387e0062b0
Fix up mb entities image links, .png -> .svg
Fix https://github.com/murdos/musicbrainz-userscripts/issues/115
2016-05-29 14:42:48 +02:00
Laurent Monin
4719a5d7d7 mblinks: swap version and expiration parameters 2015-06-16 16:16:59 +02:00
Laurent Monin
bfe25c7da5 mblinks: make expiration optional
Use a common default value of 90 days.
2015-06-16 16:16:59 +02:00
Laurent Monin
345414e11c mblinks: add support for a version from caller script
Useful to force cache reconstruction when format of keys change.
2015-06-12 16:20:56 +02:00
Laurent Monin
d982717a25 mblinks: add support for a user-specified cache key, defaulting to url
It will be needed for discogs places/labels support
2015-06-12 11:18:08 +02:00
Laurent Monin
08046d1b09 mblinks: display icon for places 2015-06-11 15:30:39 +02:00
Laurent Monin
255e933379 mblinks: take care of removal of old cache versions 2015-06-11 14:25:58 +02:00
Laurent Monin
0b49e16cae mblinks: when loading the cache, clear expired entries 2015-06-11 14:00:12 +02:00
Laurent Monin
c9a26fd00f mblinks: fix minor typo 2015-06-11 13:58:20 +02:00
Laurent Monin
ecf7681073 mblinks: store current time in timestamp, version the cache
Previously, the timestamp stored was in fact the expiration time (calculation was made at insertion),
but it makes more sense to just set timestamp to the currrent time.

This requires a cache format changes, hence the appended version.
2015-06-11 13:57:24 +02:00
Laurent Monin
0da85a03dc Ensure parseInt() base to be 10
Octal as default was dropped since ECMAScript 5, but better safe than sorry.
Also it ensures parsing '0xa' returns 0, and not 10 (hexa->dec)
2015-06-11 00:21:39 +02:00
Laurent Monin
7c67333f92 mblinks: use full query as key, code cleanup 2015-06-10 23:54:43 +02:00
Laurent Monin
1172d4ef54 Merge pull request #49 from murdos/mblinks_optim
Mblinks optimization
2015-06-10 18:21:12 +02:00
Laurent Monin
b0d221facd mblinks: fix resolveMBID(), no mblinks in this context 2015-06-10 18:20:30 +02:00
Aurélien Mino
2b54c81745 Merge handlers in ajax request context, to prevent duplicated requests
to MB webservice.
2015-06-09 00:16:41 +02:00
Aurélien Mino
cd8d7c6d98 Changed ajax requests queue implementation from a simple array to a
linked map.
The goal is to used the map feature to prevent making duplicated
requests.
2015-06-08 22:44:39 +02:00
Aurélien Mino
74ea93381e [discogs] Use mblinks cache to seed MBIDs for artists, labels,
release-group.
2015-06-07 21:49:51 +02:00
Laurent Monin
f19d8a0b0a mblinks: add a way to override link title or image for one or more types 2015-06-05 21:57:03 +02:00
Laurent Monin
b6a7eced65 mblinks: fix up release-group image source links
Issue caused by a mix up of 'release-group' and 'release_group' which remains
unseen with the bandcamp importer since it doesn't use any type with '-'.
2015-06-05 21:50:52 +02:00
Laurent Monin
3a8fef22bb searchAndDisplayMbLink(): save to cache once, after the loop 2015-06-05 17:32:11 +02:00
Laurent Monin
b7a7b0c617 searchAndDisplayMbLink(): remove check for valid type
At worse, the code will fail if an incorrect type is provided by the dev.
2015-06-05 17:26:53 +02:00
Laurent Monin
5f08654b16 Simplify initCache() 2015-06-05 17:15:04 +02:00
Laurent Monin
14179dda3f Move hardcoded musicbrainz url to a MBLinks property 2015-06-05 17:01:19 +02:00
Laurent Monin
3e16227cd9 Do '-' to '_' replacement in type once, outside the each loop 2015-06-05 16:56:37 +02:00
Laurent Monin
41c5f675cf Encode URI passed as parameter in MB ws request url 2015-06-05 16:53:15 +02:00
Laurent Monin
b306925b98 Move MBLinks js class to lib/mblinks.js, and use relative paths for @require 2015-06-05 11:13:42 +02:00