discogs-xml2db icon indicating copy to clipboard operation
discogs-xml2db copied to clipboard

Using .net discogs some data from xml isn't making it to csv

Open nelgin opened this issue 8 months ago • 3 comments

If you search Discogs for "D 250944" it comes back to "WOW Hits 2024".

If I do a search of the releases.xml file it shows up

 <companies><company><id>68920</id><name>BMG Direct</name><catno>D 250944</catno><entity_type>38</entity_type>

It looks like it's associated with the release_company but there's no catno column in the release_company table.

The only catno column is in release_label and a search reveals nothing:

MariaDB [discogs]> select * from release_label where catno like '%D 250944%';
Empty set (4.703 sec)

Can you please fix this so that all the exported data is includes in the tables. This simple omission means that I lose access to the whole CD release that I'm trying to get data for. Obviously, it'll require a change in the schema and the .net and python parsers.

nelgin avatar Mar 31 '25 09:03 nelgin

ALTER TABLE release_company ADD COLUMN catno TEXT DEFAULT NULL AFTER company_name;

I also added an index to catno for faster searching.

CREATE INDEX idx_catno ON release_company(catno);

I forgot to make a copy of the original so I don't have a diff but not many changes to make to the .net code.

DiscogsRelease.cs

 18             { "release_company", "release_id company_id company_name catno entity_type entity_type_name uri".Split(" ") },

124                     yield return ("release_company", new[] { id, c.id, c.name, c.catno, c.entity_type, c.entity_type_name, c.resource_url });

241         public string catno { get; set; }

Can't remember if 241 was already there. I guess I can check git later.

Anyway, remake the discogs dotnet binary and away you go. You'll maybe want to add something to truncate tables before doing an import otherwise I expect you'll either get a lot of duplicates, or a lot of warnings/errors.

nelgin avatar Apr 01 '25 22:04 nelgin

I'd be more than happy to accept a PR for this and thank you in advance

philipmat avatar Apr 07 '25 12:04 philipmat

Sorry, I'm not a git person. Just here to report stuff.

nelgin avatar Apr 08 '25 01:04 nelgin