INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Feature request: relate arbitrary fields  (Read 1723 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Feature request: relate arbitrary fields
« on: January 23, 2019, 03:34:21 pm »

In the soloist field, for brevity, I put only the name.
So I've created another field, soloistsort, where I put the family name and the first name.
I would love to have these two fields systematically related.
Similary for my conductor and conductorsort, composer and composersort, and many such you can imagine.
I'm sure a lot of users would love the ability to relate arbitrary fields.
Hence my feature request.

(Related question: why is it that, currently, relating fields is only possible for artist, album and series?)
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Feature request: relate arbitrary fields
« Reply #1 on: January 23, 2019, 06:50:19 pm »

First, before you create custom fields for sort, research in the forum for what other people have done. Often a special field is not required. The MC sorting functionality will achieve what you want. But sometimes it doesn't, and a sorting field adds some value. This also applies to your Artist Sort question: https://yabb.jriver.com/interact/index.php/topic,119181.msg824168.html#msg824168

Next, you have misunderstood what a Relational field is. The easiest example (though it is for video and not audio) is the [TheTVDB Series ID] field, which is relational to the [Series] field. That is, for any value stored in the [Series] field, there can only be one value for the [TheTVDB Series ID] field. So every record in the Library that has a specific value in the [Series] field has exactly the same value in the [TheTVDB Series ID] field. When [TheTVDB Series ID] field is edited, MC automatically updates [TheTVDB Series ID] field for all records which have the same value in the [Series] field as the edited record.

What you want for your sorting fields, if you need them at all, is a calculated field. That is you set up a new field as "Calculated data" rather than "User data" in the "Data" section of the field definition. Then you just enter an Expression in the field that opens up, and that expression will define what appears in the field. So you could have a [Soloist] of "Mary Weinstein" but use the Swap function for your new [Soloist sort] field to change that to "Weinstein, Mary".

There are a bunch of string manipulation functions to do such stuff. There are also a bunch of threads about using Swap and Unswap, and other sorting questions, to achieve what people want in a View.

But often you can just use an Expression to sort a View the way you want, and do not need an extra field to do it.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #2 on: January 24, 2019, 01:10:37 am »

When I'm tagging a new album, I only input the family name of an artist, soloist, and conductor.
So the field conductor could be related to a custom field (conductor sort), my job would be done.

Similarly, I might want to relate, say, orchestra with a custom field orchestra information.
Etc.

Hence my request (and the related question above).
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Feature request: relate arbitrary fields
« Reply #3 on: January 24, 2019, 01:56:58 am »

Maybe provide some examples of what would be in the four fields you mentioned, and how you saw it working, for better understanding.

As to your related question, each of those fields is a key field and has functionality around them written into the code, to provide the relational functionality. MC doesn't have any generic ability to relate fields. The Library isn't, in a commercial sense, a general relational database.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #4 on: January 24, 2019, 02:11:03 am »

OK, thanks.

Here is an example of what I was saying.
Quote
When I'm tagging a new album, I only input the family name of an artist, soloist, and conductor.
So the field conductor could be related to a custom field (conductor sort), my job would be done.
[conductor]=Solti
[conductor sort]=Solti, Georg
[orchestra]=Chicago Symphony Orchestra
[orchestra initials]=CSO
[soloists]=Argerich
[soloist sort]=Argerich, Martha
I'd like to automatically relate [conductor] and [conductor sort], [orchestra] and [orchestra initials], [soloist] and [soloist sort].
This way, when I tag a file or an album, I just have to fill the three fields [conductor], [orchestra] and [soloist], and not the 6 of them. (In particular, I don't have to indicate the full information Name, First name in the sort tags.)

(Of course, for this to be efficient, this requires a unique association between the values. I'm careful about that, especially when several people have the same family name. When this happens, I use two different values for the field [soloists], eg: Chung_KW and Chung_MW. But in my collection, this happens rarely.)
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Feature request: relate arbitrary fields
« Reply #5 on: January 24, 2019, 03:19:31 am »

I'm not sure how you get the Conductor name (Georg), the initials of the orchestra (CSO) and the Soloist name (Martha) by filling in the 3 fields Soliti, Chicago Symphony Orchestra and Argerich  ?

Anyways,  if it was me I'd set up actions in MP3Tag to populate the tags auto-manually (as automatically as you feel comfortable with). But that's probably not to your liking.

Spike

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #6 on: January 24, 2019, 04:53:02 am »

I don't understand what you mean about Georg Solti, Martha Argerich and Chicago Symphony Orchestra (CSO).
The user defined fields [soloist sort], [conductor sort], [orchestra initials] are not calculated, they are manually filled.
(Orchestra initials could be calculated, I supose, but some orchestras would receive the same initials, such as Philadelphia Orchestra and Philharmonic Orchestra. In my current system, I manually assign PO to the former, and PhO to the latter.)

I would like the process to be automatic.
It would be if the fields were related as indicated.

I would like to avoid doing do a special manipulation. But currently, I have to do several if I want all these fields to be populated. And the more albums to tag, the more time the whole process takes.
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Feature request: relate arbitrary fields
« Reply #7 on: January 24, 2019, 05:23:22 am »

MP3Tag is a powerful tool. 'actions' could automate much of what you need. Simple sorting would highlight other sections that can then be bulk edited (eg initials/abbreviations). YMMV  :)

Spike

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #8 on: January 24, 2019, 05:39:42 am »

I don't see how you would do what I want (full automation, using the powers of a database) using MP3tag's actions.

And even if it were possible, this would require me to use another program, while I'm trying to do as much as possible with MC. Hence the feature request for MC, not for MP3tag :)
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Feature request: relate arbitrary fields
« Reply #9 on: January 24, 2019, 06:12:10 am »

Thanks for the examples. It demonstrated what I thought.

What you are actually looking for a Lookup Tables. That is, you want to enter a value in one field, then have the software lookup that value in a table, get the related value from that table, and put the result into another field. i.e. Enter "Solti" into the [Conductor] field, have the software lookup "Solti" as the key/index in a Lookup Table, then find the associated value of "Solti, Georg", then write that value to the [conductor sort] field.

Unfortunately, MC doesn't have anything like that, at all. As I said, it isn't really a relational database (people will, and have, argued with me about that), and you can't add extra tables to the database, and certainly can't add Lookup Tables. Whenever this sort of thing has been required by other users, if they really wanted it and the scope was limited, then they wrote large Expressions that had conditions in them and included all possible values. Typically large Ifelse Expressions. That would mean an Expression that had all possible Conductors, and their associated full names, for example. The scope of your requirements is not limited. Expressions are not a practical solution.



But all is not lost. MC will dynamically generate a drop-down list of all matching values when you start to enter a value into any field. So data entry can be quite fast. For example, if your Library is anything like mine, you have many variations of the "Rock" Genre. If you edit the [Genre] field and start typing "R" you will get a drop-down list of any Genre that includes "R". Continue with "o" and you get anything with "Ro" in it. By the time I type "Rock" I get only Genres in the drop-down list that include the word Rock and it is easy to select the correct value. This has the benefit of standardising data entry, to avoid spelling errors or the creation of similar values in a field. For example, "Heavy Metal" and "Heavy Metal Rock" should probably be considered the same, so only one of those should be used in the Library. The drop-down list can assist with that.

The other benefit of just using the drop-down lists as intended is that you don't need three new custom fields as per your example. It is easy just to use the standard field to enter the full value. If you still wanted to have the abbreviated values in the Library, for use in Views or whatever, you may be able to create a custom field with a standard Expression to create the abbreviation. For example, to take just the Last Name from the [Conductor] field and put it into a [Conductor Surname] field or similar.

That's the best idea I have. I hope if anyone has a better idea they speak up!  I'm not too proud to be wrong, or learn new stuff. ;)
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Feature request: relate arbitrary fields
« Reply #10 on: January 24, 2019, 07:14:09 am »

I don't see how you would do what I want (full automation, using the powers of a database) using MP3tag's actions.

I was starting from the point that's probably never ever going to happen in MC so alternative strategies might be useful to get the results you're after; but it seems not.

Spike

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #11 on: January 24, 2019, 07:18:00 am »

Thanks, Roderick.

I was thinking along the same lines. Given how MC currently works, the best solution would be to enter the full name (family name, first name). Then next time I type, say 'Arg', the list should quickly show me 'Argerich, Martha'.

My only problem is that I currently have at least 300 soloists without corresponding first name (soloists for whom my [soloist sort] is empty). However, I could fill only the gaps I want, on a case by case basis.

I would still need to recover easily the family name for thumbnail text display (eg when I do have 'Argerich, Martha'). What would be the best regular expression to do so? Something that would give me the part of the string before the comma?
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #12 on: January 24, 2019, 07:19:13 am »

I was starting from the point that's probably never ever going to happen in MC so alternative strategies might be useful to get the results you're after; but it seems not.
I was hoping something could be done in MC along the lines of what I was suggesting.
But all right, then, can you explain me precisely what I could do with such actions in mp3tag?
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #13 on: January 24, 2019, 08:17:57 am »

Quote from: 8139david
I would still need to recover easily the family name for thumbnail text display (eg when I do have 'Argerich, Martha'). What would be the best regular expression to do so? Something that would give me the part of the string before the comma?
I found the beginning of an answer:
regex([soloist sort], /#^(.+?),#/,-1)[R1]

However, this only gives me the string before the first comma.
When a file has multiple soloists, I would need all the strings preceeding commas.
Eg, if [soloist sort]=Argerich, Martha;Perlman, Itzhak     then I would need to retrieve: Argerich;Perlman.
 
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #14 on: January 24, 2019, 12:43:38 pm »

Globally, however, I'm quite happy with my current set-up:
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Feature request: relate arbitrary fields
« Reply #15 on: January 24, 2019, 04:09:19 pm »

You're welcome David.

Unfortunately, I'm no Regex expert. More an amateur. I'm not that brilliant at MC's expression language for handling this sort of thing either.

Maybe BLGentry will notice the call for Regex help. He is an expert in the subject.

I think there are examples on the forum of what you wish to do. There are a bunch of List Manipulation Functions that may help, as [Conductor] and [Soloist] are list type fields. I think you could combine those with Regex or other String Manipulation Functions to achieve what you want.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Feature request: relate arbitrary fields
« Reply #16 on: January 24, 2019, 08:11:38 pm »

If I futzed with it enough I might be able to come up with a regex that would do this.  The problem is that it's a variable length record.  It might have 1, 2, 3, or more entries, each separated by an optional semicolon.  You could write a really ugly regex that accounted for something like 5 such entries and then output the last name of each, but you would end up with extra separators in your output because I don't think there's any way to count the number of output items.  It's really messy.

Which means it's the wrong solution in my mind.  MC would benefit from a "list break out" function of some sort.  But that implies some kind of looping, which MC explicitly does not have.  Well, not exactly, as it has implicit looping and it has global variables.  But global variables are their own kind of messy and I'm no longer interested in playing with them.  Though they DO have power and if you are really into making MC dance and sing to your delight, global variables can do a lot!

I'll think on this some more, but right now I don't know any good programatic ways to solve this.  All of my solutions seem very manual.  Others involve using another tool and doing import/export.

Brian.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #17 on: January 24, 2019, 09:05:46 pm »

Thanks for thinking about it, Brian.
As I suggested, I don't mind having a separator in my output, namely ';'.
I don't think I have more than 5 soloists ever listed, so one could set 5 soloists as a limit.

However, there is another complication: if I changed my practice as envisionned, then the field [soloists] (or [conductor]) would have the information 'family name, first name', while others would only have 'family name'.
And then later on, there might be mixes of the formats, eg a track having [soloist]=Argerich;Perlman, Itzhak;Fournier. That could happen if I replaced 'Perlman' by 'Perlman, Itzhak' in my whole library, while doing nothing for the other 300 soloists that don't yet have their first name recorded.

Alternatively, if there is a simple solution using an external program (such as MCUtils, MP3tag, etc), then I can try it.
It's interesting if I can easily process my whole collection (or a big chunk of it). It's not if it has to be album by album.
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Feature request: relate arbitrary fields
« Reply #18 on: January 25, 2019, 02:45:51 am »

There are a few ways to tackle this:
You either keep chipping away at it and your final goal evolves over time

or

You design your final goal now and follow that design to the end.

I'm not sure which path you are following which makes it hard to offer advice. I think you are now aware that there isn't one tool to do what you are looking for. So you'll need to use multiple tools or one tool and some manual manipulation.

Do try MP3Tag; it's grid based and can open your entire collection at once. You can then sort on any column (Tag) and write/use and expression to fix a whole block of tags with a similar 'issue', you don't have to do it album by album. Empty tags are obvious, it does internet look ups actions can be automated, has an excellent support forum, supports video tags (where available) as well now.. YMMV of course  ;)

Spike
Spike

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Feature request: relate arbitrary fields
« Reply #19 on: January 25, 2019, 03:13:31 am »

Spike, unless you give me precise explanations of how it would go, this isn't useful.
Given what you have said, MP4tag appears no relevently different than MC.
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Feature request: relate arbitrary fields
« Reply #20 on: January 25, 2019, 05:43:08 am »

MP3Tag is the same as MC in so much that you can edit Tags in it, it just does it differently. I find it useful for getting an overview of my entire collection in one simple 'grid'. It's dedicated to editing tags so it's very efficient and powerful and is able to produce consistent results as well as spotting errors or omissions very quickly.

I don't have the time to give you a personal tutorial on how to use it; there's plenty of info out there on the product. If it's not for you then it's not for you. It's only a suggested tool for the toolbox that might help with the tagging style you are trying to adopt.

Spike

timwtheov

  • Galactic Citizen
  • ****
  • Posts: 354
Re: Feature request: relate arbitrary fields
« Reply #21 on: January 25, 2019, 07:14:04 pm »

8139david, have you looked into MCUtils?

https://yabb.jriver.com/interact/index.php?topic=100449.0

I'm thinking you could do a little bit of this in MC using CSVLookup, which will populate other fields based on another field, using a CSV file, i.e., an exported (Excel) smartlist.

I use amg.pl in MCUtils to tag all my albums, but many classical releases (especially box sets) aren't on Allmusic, so for those, I have a [Composer] smartlist with about 10 different fields attached to each name (e.g., [AMG Composer Born], [AMG Composer Died], [AMG Composer Period], and so forth, obviously all derived from Allmusic via amg.pl) and a similar compostion ([AMG Work Name] in my system) smartlist. Once I fill in [Composer] and [AMG Work Name] from either Allmusic or from the drop-down list in MC, all I have to do is run the CSV command line and presto! all the fields named in my smartlist are filled in with whatever are on the Excel spreadsheets I exported from the smartlists. Couldn't you do something similar with your orchestra and soloist fields?

There's a bit of a learning curve with MCUtils if you're not used to using Perl or command lines, but once you get it set up, you won't go back. I actually redid a substantial amount of tagging on both classical and non- once I got going with MCUtils' amg.pl and CSVLookup. It's that good.

Anyway, check it out and PM me if you want some help setting stuff up.
Logged
Pages: [1]   Go Up