Commit graph

76 commits

Author SHA1 Message Date
Laurent Monin
b9039569c7
Revert a change from 0e597ddb8 that breaks duration parsing in some userscripts
CD1D importer is failing to parse durations with isNaN() so revert to previous code
2018-12-09 20:19:52 +01:00
Laurent Monin
0e597ddb87
Merge pull request #197 from murdos/code-cleanup
Code cleanup
2018-12-06 12:12:36 +01:00
Jaakko Perttilä
abc8c4ba36 mbimport.js: Add support for disambiguation comment 2018-11-28 23:40:48 +01:00
Aurélien Mino
785b790887 Fix "use-isnan" eslint rule 2018-11-20 23:37:47 +01:00
Aurélien Mino
14d9606e2e Fix "no-empty" eslint rule 2018-11-20 23:28:53 +01:00
Aurélien Mino
73fac72d7b Use template literals for css blocks 2018-11-20 23:23:38 +01:00
Aurélien Mino
14a32dab62 Applied prettier and eslint tools on existing code
None of these changes are manual changes made a human
2018-11-20 23:18:49 +01:00
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
7efc1bec72 Improve feat/vs matching regexps
Previous version was incorrectly converting ie. 'left boot' to 'le feat. boot',
new version handles this correctly.
2015-09-09 08:04:14 +02:00
Laurent Monin
5a354070d0 Fix missing whitespace in edit note message when format is set.
Only CD1D importer use format for now.
2015-06-22 11:26:27 +02:00
Laurent Monin
603450ec4f Better handling of Various Artists and other special artists
Let each script set the correct artist, instead of doing automagically in mbimport.
2015-06-21 17:25:44 +02:00
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