scene release to discogs release
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 2 години
преди 2 години
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # rls-discogs
  2. scene release to discogs release
  3. # using
  4. - [fish](https://fishshell.com/)
  5. - [discogs-xml-to-elasticsearch](https://github.com/SuperToma/discogs-xml-to-elasticsearch)
  6. - [curl](https://curl.se/)
  7. - [jq](https://stedolan.github.io/jq/)
  8. - [websocat](https://github.com/vi/websocat)
  9. # flow
  10. scene rls name > parse > artist / title / year as .tsv > search discogs > .json
  11. # tools
  12. - `in-ws-predb.ovh.sh` read scene release names from predb websocket
  13. - `parse-rls.fish` parse scene release name
  14. - `search-discogs-api.fish` search discogs release using Discogs REST API
  15. - `search-discogs-elastic.fish` search discogs release using ElasticSearch
  16. - `out-fallback.jq` fallback search helper
  17. - `out-ids.jq` filter ids from json output
  18. - `out-simple.jq` filter genre from json output
  19. # usage
  20. parse rls name as tab separated values
  21. ```
  22. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish | column -t -s "$(printf '\t')"
  23. Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC Kraftwerk Autobahn CD Remastered 2009
  24. ```
  25. parse rls name as json
  26. ```
  27. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish -j | jq .
  28. {
  29. "artist": "Kraftwerk",
  30. "barcode": null,
  31. "catno": null,
  32. "edition": "Remastered",
  33. "format": "CD",
  34. "rls": "Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC",
  35. "title": "Autobahn",
  36. "year": "2009"
  37. }
  38. ```
  39. parse rls name, search local ElasticSearch, output discogs ids
  40. ```
  41. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish | ./search-discogs-elastic.fish | ./out-ids.jq
  42. {"artist_id":4654,"master_id":2994,"release_id":1966322,"rls":"Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC"}
  43. ```
  44. get rls names from websocket, parse rls name, search with api.discogs.com, write .json
  45. ```
  46. $ ./in-ws-predb.ovh.sh | ./parse-rls.fish | search-discogs-api.fish > out.api.json
  47. ```
  48. parse rls name, search local ElasticSearch, write json, filter empty results and convert json to tsv, fallback search with Discogs API, write json
  49. ```
  50. $ echo 'Band_Of_Horses-Things_Are_Great-CD-2022-FATHEAD' | ./parse-rls.fish | ./search-discogs-elastic.fish | tee out.es.json | ./out-fallback.jq | ./search-discogs-api.fish > out.api.json
  51. $ jq ._search_result_count out.es.json out.api.json
  52. 0
  53. 1
  54. ```