Commit graph

65 commits

Author SHA1 Message Date
Aurélien Mino
a4b23129d0 Refactoring: renamed import_functions lib to mbimport. 2015-06-18 00:29:08 +02:00
Laurent Monin
304affacc7 import_functions: only autoset mbid for special artists if mbid is lacking 2015-06-17 15:04:38 +02:00
Laurent Monin
49eef81c43 Advertise the userscripts homepage in the edit note. 2015-06-17 11:51:51 +02:00
Laurent Monin
f7552d244a Merge pull request #56 from zas/discogs_search_entities
Discogs importer: display links for direct search of entities on MB
2015-06-17 09:47:09 +02:00
Laurent Monin
4349c66f07 Import buttons: minor style improvement 2015-06-16 16:17:00 +02:00
Laurent Monin
9ee0a2ee48 Add Search button to all importers and improve integration on each website 2015-06-16 16:17:00 +02:00
Laurent Monin
4d96e7bffa luceneEscape: also escape slash 2015-06-16 16:17:00 +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
5a4058eb6b discogs_importer: display search links for not-yet-found entities 2015-06-15 23:09:26 +02:00
Laurent Monin
1a07a75774 import_functions: add searchUrlFor() which returns an url for search of given entity 2015-06-15 23:09:22 +02:00
Laurent Monin
4bd4b74c7f import_functions: set artist mbid for Various Artists and [unknown] 2015-06-15 17:23:24 +02:00
Laurent Monin
565c776910 import_functions: add a function to parse ISO8601 durations 2015-06-15 13:59:09 +02:00
Laurent Monin
5a2d439d55 Unify the style of the MB import button among websites
- display musicbrainz icon in it
- unify css style
- add a new lib/mbimportstyle.js (store functions inserting css)
2015-06-15 09:52:59 +02:00
Laurent Monin
42bb4890ca hmsToMilliSeconds(): fix an issue with Bandcamp "hidden" tracks
str may be null, so check.
2015-06-15 09:50:40 +02:00
Laurent Monin
0f8ad4e971 import_functions: add a class to the search link, tidy up code a bit. 2015-06-14 14:13:56 +02:00
Laurent Monin
d76525949e import_functions: add a class to the form element 2015-06-14 14:13:00 +02:00
Laurent Monin
c3899a73b4 import_functions: use a button type=submit instead of an input
It is easier to style, same behavior.
2015-06-14 14:11:39 +02:00
Laurent Monin
8c29ca5c3f import_functions: makeArtistCredits() now splits featuring or versus artists 2015-06-13 15:18:04 +02:00
Laurent Monin
6d44668600 importers: move release type guessing to fnBuildFormParameters()
- use milliseconds for track durations everywhere for consistency
- use total duration in guessing only if all tracks have a duration
- improve a bit the differenciation single/EP/album
- it only happens if no release type was set by user script
2015-06-13 04:25:31 +02:00
Laurent Monin
529561b389 import_functions: use same protocol than the page we are on for the form
It prevents the warning on beatport pro (https)
2015-06-13 04:19:48 +02:00
Laurent Monin
a6c983b785 import_functions: add other_databases url type 2015-06-13 00:55:28 +02:00
Laurent Monin
ac4e33f43d import_functions: add discogs url type 2015-06-13 00:15:20 +02:00
Laurent Monin
6991a5ad6f import_functions: add purchase_for_mail_order url type 2015-06-13 00:08:58 +02:00
Laurent Monin
be4e3ef1a6 import_functions: add guessReleaseType() helper
- it tries to guess the release type based on title, number of tracks, and total duration
- it will be used to provide a sensible default value for type in importers
- it will fail to guess sometimes of course, but editor has to check values set by importer
2015-06-12 22:40:40 +02:00
Laurent Monin
ad1f0e3e51 import_functions: add makeArtistCredits() function to build artist credits 2015-06-12 22:01:06 +02:00
Laurent Monin
7c3a39c79d import_functions: add URL_TYPES property 2015-06-12 21:28:24 +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
Aurélien Mino
3f00813732 Fix seeding of artist credit MBID and add support for seeding
release-group MBID.
2015-06-07 21:48:00 +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