INTERACT FORUM

Please login or register.

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

Author Topic: Advanced Tag Editing: Remove Actors With Only One Title  (Read 9312 times)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Advanced Tag Editing: Remove Actors With Only One Title
« on: March 03, 2021, 05:05:36 pm »

I have imported lots of actors to my movies library ('Actors' column header shows +10,000 entries)... Now I look for a way to remove some who appear in only one film, so as to make the list easier to search...

- One idea was to sort the 'Actors' column by 'Number of Files' (via 'Edit > Category > Sorting'), then select all entries with one title. This will display all movie files with selected actors in the file list below, but removing the entries selected in the column would also remove all the files below, so no way.

- Likewise, if I select all the files listed below, then open Tag Editor to remove the actors, I would have to un-select one by one, because all actors are listed there, including those I want to keep...

I also tried using the Wizard ('Edit Search'), but there is no option to combine the 'Actors' field with the modifier 'Limit number to'...  Is there a way (e.g. database expression) to filter a view for 'one-film-only' actors, so then I can simply clear the actors field in Tag Editor, without affecting the other entries?

Looking forward to your helpful ideas! Thanks ahead ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Database Experts: Remove Actors With Only One Title
« Reply #1 on: March 03, 2021, 07:50:22 pm »

This is definitely possible using a smartlist to filter a View. I've explained similar functionality before in a few different places. Read this post: https://yabb.jriver.com/interact/index.php/topic,127718.msg886526.html#msg886526

Particularly the part at the bottom about the One-Hit Wonder Remover smartlist (though the entire thread may be illustrative).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #2 on: March 03, 2021, 08:31:06 pm »

This is definitely possible using a smartlist to filter a View. I've explained similar functionality before in a few different places. Read this post: https://yabb.jriver.com/interact/index.php/topic,127718.msg886526.html#msg886526

Hi, thanks for your input! So, I have now tested this filter "~limit=-1,1,[Actor]", added under 'Search > Modify > Limit (advanced)', but it doesn't have the desired effect... I'm not sure what this expression does exactly, but the result are both actors with one or more titles to their name...

It seems that my particular usage case is not covered by the expression language as such... Quite sure there is no other way?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Database Experts: Remove Actors With Only One Title
« Reply #3 on: March 04, 2021, 07:39:27 am »

Nope. That's not what you want to do. You need a separate smartlist with the ~limit rule. I explain why here:
Make a separate smartlist called "One Track Artist Remover" (or whatever you want, but that's what mine is called). You won't actually use this List for anything other than "filtering" so you might want to bury it in a "utility" Playlist Group (mine are in Utility\View Filters\ under Playlists). Give it this Search:
Code: [Select]
[Media Type]=[Audio] [Media Sub Type]=[],[Music] ~limit=-1,1,[Artist] ~sort=[Artist]
That makes a list of all Artists in your Library, with one randomly-selected track per Artist. Here's the beauty part: If you only have one track for a particular Artist, then that will be the track "selected" for that Artist (the ~limit won't be random in that case, it'll select the only one there is).

So, in your case, the smartlist rule would be something like:
Code: [Select]
[Media Type]=[Video] [Media Sub Type]=[Movie] ~limit=-1,1,[Actor] ~sort=[Actor]
That will make a list of movies with one movie from each Actor you have in your Library (and only one). If you have multiple movies with the same Actor, it will randomly pick one. But if you have only one movie with a particular Actor, it will pick that one (it won't be random, there can only be one).

Then, back in your View, you remove the files contained in that smartlist you just made (eliminating all of those files): -p=Path\to\your\smartlist

Then, lastly, in the View, you add ~expand=Actor to the end. This will add back in the "random" files the ~limit removed (the files where the Actors have more than one result) while leaving out those for which there were only one result (because they are no longer in the list at all for ~expand to act upon them). Leaving you with a View that shows only Actors for which there are at least 2 results.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #4 on: March 04, 2021, 08:20:05 am »

Glynor, I don't think that works. [Actors] is a list, and it seems ~limit treats it as a full string so it only eliminates entries with the same exact list of Actors.

Getting a list of Actors that are only on one movie is doable with a Categories View using an Expression group:
Expression to group by = [Actors]
Expression to Display = GroupCount() - [Actors, 1]
Sorting: Number of Files

Then you can also adjust the Thumbnail Text on that view to "groupCount() - [Name]".

Removing those 1-movie Actors though... tricky. Maybe doable with a complex Expression using GroupCountQuery(). (nope)
And what about cases where the movie has a single Actor listed? I have a few tens of those, mostly Documentaries and Animated shorts.

Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Database Experts: Remove Actors With Only One Title
« Reply #5 on: March 04, 2021, 08:44:35 am »

It works fine on [Artist] which is also list type (it was basically designed for [Artist] originally). Are you sure?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #6 on: March 04, 2021, 09:15:21 am »

The smartlist you gave lists almost all my files, so the View filter (-p=smartlist ~expand=Actors) returns only 90 files or so.
But with the View grouped by Artist, I can see that about 60% or the artists are on a single movie (thousands).

There's another problem with this approach: I have some foreign movies where ALL actors are just on that movie. So removing them doesn't make sense, would result in the movie having no listed actors.

Quote
That will make a list of movies with one movie from each Actor you have in your Library (and only one). If you have multiple movies with the same Actor, it will randomly pick one.
I actually see multiple movies with same Actor (but different list of actors) on the smartlist results. This probably happens because:
- movie 1 has Actors A;B;C;D;E - this one gets selected as the limit for A
- movie 2 has Actors A;F;G;H;I - this one gets selected as the limit for F

So both movies will be listed, but both movies have A.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Database Experts: Remove Actors With Only One Title
« Reply #7 on: March 04, 2021, 02:09:02 pm »

Hmmm. It must operate differently on [Actors] than it does on [Artist]. I'll test it myself later tonight to see if I can reproduce it.

There's another problem with this approach: I have some foreign movies where ALL actors are just on that movie. So removing them doesn't make sense, would result in the movie having no listed actors.
I actually see multiple movies with same Actor (but different list of actors) on the smartlist results. This probably happens because:
- movie 1 has Actors A;B;C;D;E - this one gets selected as the limit for A
- movie 2 has Actors A;F;G;H;I - this one gets selected as the limit for F

This shouldn't, if ~limit works correctly with list-type fields, matter. The whole idea is to eliminate ALL instances of a particular person. And then when you ~expand on the list in your View, it won't expand those people (and the ~expand will fix everything else). The contents of the "filter smartlist" don't matter, so long as they include the one matching file with that particular person in it.

But, if ~limit really doesn't work right with list-type fields, then it would get all screwed up. Like I said, it works okay on my library and I use it extensively with [Artist]. But [Artist] is special. (Or multi-artists are so infrequent in my library, though not that infrequent, that it hasn't previously interfered with my usage of the trick anyway.)

If anyone from JRiver is looking at this, could you comment if ~limit does, or is supposed to, work on list-type fields properly?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #8 on: March 04, 2021, 02:43:56 pm »

Many thanks to you both! I have tried Glynor's "~limit=-1,1,[Actor]" scheme once more, but (much like yesterday) the smartlist returns almost all movie files, not 'one-title-only' actors (obviously, for a list can return only titles, not names etc... ;-)

This can't work, because I'm looking for the opposite -- that is "Actors with 1 Title only", NOT "Titles with 1 Actor only", with 'Actor/Artist' being the same list types... In plain words, my search would be sth like this (please translate into MC's expression language ;-):

"Titles with Actors who have only 1 Title to their name"

Zybex's suggestion is similar to what I tried already, using the 'Actor' category, sorted by number of titles (or sort the column that way, see 1st post) -- but either way lets me remove actors from results one by one only, not all in a batch... Whether in Tag Editor or via 'column tagging', to de-select thousands of entries manually would just take me too long, and there is no menu option to untick all selected actors...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #9 on: March 04, 2021, 03:22:44 pm »

Edit: Back in my View, I tried to follow Glynor's idea, with the resulting search expression:

"-playlistid==1052090937 ~expand=[Darsteller/in]"

Where the 'playlist id' points to the new smartlist "Darsteller/in" (sth like 'bi-gendered' German for English "actor/esses" ;-), created using the "~limit=-1,1,[Actor]" expression...

But again, the result is listing all movie files... I think the issue lies with the basic difference that each file can have only 1 'Title' value, but multiple 'Actor' values...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #10 on: March 04, 2021, 04:36:07 pm »

You'll need to manipulate it outside of MC, either via a script or Excel (plus SWOT to re-import the data)
A 20-line 40-line VBA function in Excel can do it, if you feel your life doesn't have enough pain already ;D

Edit: VBA works ;)

Code: [Select]
Sub countUniqueActors()
    Dim name As String
    Dim Names() As String
    Dim cel As Range, all As Range
    Set d = CreateObject("Scripting.Dictionary")
    lastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row + 1
   
    AllowZeroActors = False     'change to True to allow removing all actors from a movie (if they're all unique)
    ListRemovedActors = False   'change to True to write the removed actors on the next column (overwrites existing data there!)
   
    Set all = Application.Selection
    If all.Cells.count < 2 Then
        MsgBox ("Please select a range of cells")
    Else
        ' phase 1 - count each actor occurences
        For Each cel In all.Cells
            If cel.Row > lastRow Then Exit For
            If cel.Value <> "Actors" And Trim(cel.Value & vbNullString) <> vbNullString Then
                Names = Split(cel.Value, ";")
                For i = LBound(Names()) To UBound(Names())
                    name = LCase(Trim(Names(i)))
                    count = d(name)
                    d(name) = count + 1
                Next
            End If
        Next
       
        'count unique items in dictionary
        once = 0
        For Each n In d.Keys
            If d(n) = 1 Then once = once + 1
        Next
       
        'phase 2 - cleanup unique actors, except if all actors in a movie are unique
        If vbYes = MsgBox(Str(d.count) & " actors, " & Str(once) & " seen only once." & vbCrLf & vbCrLf & "Do you want to Cleanup?", vbYesNo) Then
            For Each cel In all.Cells
                If cel.Row > lastRow Then Exit For
                If cel.Value = "Actors" And ListRemovedActors Then cel.Cells(1, 2).Value = "Removed"
                If cel.Value <> "Actors" And Trim(cel.Value & vbNullString) <> vbNullString Then
                    newval = ""
                    Names = Split(cel.Value, ";")
                    removed = ""
                    For i = LBound(Names()) To UBound(Names())
                        name = LCase(Trim(Names(i)))
                        If d(name) > 1 Then
                            newval = newval & "; " & Trim(Names(i))
                        Else
                            removed = removed & "; " & Trim(Names(i))
                        End If
                    Next
                    newval = Trim(Mid(newval, 3, Len(newval)))
                    removed = Trim(Mid(removed, 3, Len(removed)))
                    If (AllowZeroActors Or newval <> "") And newval <> cel.Value Then cel.Value = newval Else removed = ""
                    If ListRemovedActors Then cel.Cells(1, 2).Value = removed
                End If
            Next
            MsgBox ("Done!")
        End If
    End If
End Sub
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #11 on: March 04, 2021, 05:20:01 pm »

Million thanks @ zybex for all that labour... Not sure if I will go to such extremes (the VBA code looks daunting... ;-)

So how to apply the Excel function? I guess the first steps are like this:

  • Group my view by actors,
  • sort by number of titles,
  • select the 'one file-per-actor' titles
  • export the selection to an Excel file,
  • ...?

By the way, there IS a major difference between the 'Artist' and 'Actor' fields; while both are the 'semicolon delimited list' type, the input type for 'Artist' is 'Standard', for 'Actor' it is 'List'... As a result (see prev. post), each file/title can have only 1 artist, but multiple actors to it!

Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #12 on: March 04, 2021, 05:27:35 pm »

No need for Views or Smartlists.
- Just open any View in Details mode (or Video->Files), make sure the Actors column is visible, CTRL+A to select all, CTRL+C to copy.
- Open Excel, CTRL+V to paste. Select all cells from the Actors column (do NOT select the entire column or else the code will have to check 1 million rows! Code needs fixing to prevent that)
- ALT+F11 to open the VBA editor, double-click on This Workbook, paste the code.
- Press PLAY on the VBA Editor toolbar

That should clean up the names in the Actors column... but now you have the problem of putting it back into MC. Bulk copy/paste doesn't work from Excel to MC, so you'll have to use SWOT/Fiddler or something like that. as Wer says below, you can just paste back the column into MC.

Instructions:
https://yabb.jriver.com/interact/index.php/topic,106802.msg742297.html#msg742297
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #13 on: March 04, 2021, 05:51:12 pm »

... but now you have the problem of putting it back into MC. Bulk copy/paste doesn't work from Excel to MC, so you'll have to use SWOT/Fiddler or something like that.

Pasting from Excel into MC works fine, but you can only paste one tag at a time.

So you'd have to select the cells (in a column) that comprise your Actors field (don't select the header row), and when you do a paste tags, check only the Actors field.

The number of cells in the clipboard must exactly match the number of files selected in MC.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #14 on: March 04, 2021, 06:47:39 pm »

So you'd have to select the cells (in a column) that comprise your Actors field (don't select the header row), and when you do a paste tags, check only the Actors field.
The number of cells in the clipboard must exactly match the number of files selected in MC.

Thanks @ wer, I might give that a shot, once I understand what you mean by "paste tags, check only the Actors field", how does that go in MC?

And by the way, the resulting Excel cells will never match the number of files I first selected in MC -- there will be thousands less once I've removed the 'one-film' actors (which was the overall idea... ;-)

Or let me know if I got anything wrong -- many thanks again for all your effort!
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #15 on: March 04, 2021, 07:20:02 pm »

Thanks @ wer, I might give that a shot, once I understand what you mean by "paste tags, check only the Actors field", how does that go in MC?
When confronted with new concepts in MC, a good idea is to google "jriver feature name".  :)  "jriver paste tags" in this case.

"Paste tags" is one of the edit commands on the right click menu. I'm sure you'll find it if you look. It has a dialog when invoked, which will explain the rest of my comment.
https://yabb.jriver.com/interact/index.php?topic=71801.0

And by the way, the resulting Excel cells will never match the number of files I first selected in MC -- there will be thousands less once I've removed the 'one-film' actors (which was the overall idea... ;-)
Wrong.  You're not thinking about what you're actually doing.  You're not deleting files, you're modifying fields (namely [Actors]) for a set of files.  There is one Actors cell in each row, and one row for each file.  So the number of Actors cells present is exactly equal to the number of files you copied from MC.  And the number of cells you COPY FROM EXCEL must exactly match the number of files you select in MC when you do the PASTE INTO MC.


You're going to select x number of files in MC, and paste those tags into Excel.  So you have x rows of data in Excel to edit, right?  Then you edit them.

You will have then modified SOME fields in Excel, either manually or by using the vba Zybex generously gave you.

So you now have a choice: copy ALL the rows back into MC, including the unmodified ones, or copied only the modified ones.  Right?

So you select a certain number of cells, containing the [Actors] data you want to copy back to MC.  You hit Ctrl-C to copy.

You must then select the corresponding files in MC. The exact same files, in the exact same order. The exact same number of files. And when you have selected these files, you do a Paste Tags.

So to be even more specific, if you select 1000 files and copy their data to Excel, you will have 1000 rows in Excel.  Say you modify 100 fields, deleting one actor from each one.

So are you going to copy back only the 100 files you modified, or all 1000?  The number of files/cells you copy from excel must match the number of files you select when you paste into MC.  It's very straightforward. 

Make sense?
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #16 on: March 04, 2021, 07:37:44 pm »

Of course, I forgot that cells in Excel will only be changed (or cleared in some cases) but not deleted, so the overall number stays the same.
This resolves my latest comment, so I'll have a go at it and post the result here. Thank you so much!
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #17 on: March 05, 2021, 02:29:32 am »

Thanks Wer, I forgot about that feature.

Andrew, make sure you backup the database before you mess it up ;)
You have to do it all in one go, not in chunks, or else the script will see names as unique when in fact they're also used elsewhere. Just select all files in MC, copy to excel, do the script thing, and copy back the whole Actors column (without header) into MC. Then check the first, last, and a few in the middle to make sure the paste was not misaligned.

The script will not clear any cell. There's a check there: if all actors in a given cell are unique, it won't remove them. This is to prevent movies with no actors.
I added a couple of vars that you can change at the top:
Code: [Select]
    AllowZeroActors = False     'change to True to allow removing all actors from a movie (if they're all unique)
    ListRemovedActors = False   'change to True to write the removed actors on the next column (overwrites existing data there!)

Fix: The VBA now checks what's the last used row to prevent going all the way to 1 million rows.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #18 on: March 05, 2021, 03:09:10 am »

Thanks Wer, I forgot about that feature.
That's ok, there are so many features, forgetting about them seems almost obligatory.

Fix: The VBA now checks what's the last used row to prevent going all the way to 1 million rows.
And now you have to edit your post again to reflect that the code is now 20 40 50 lines.  Which will be a lesson to you not to write code for people when they want to attempt stuff like this! I leave those as "an exercise for the reader".  You're such a softie. ;D


Andrew, it's a good idea to back up the database, as Zybex says, since you are new to this.  So I should point out to you that the paste tags of the data back into MC is risky, if you're not careful.

There is no error checking done on the paste tags, other than checking that the number of items in the clipboard match the number of files selected in MC.  The contents of the clipboard are pasted "as is", in the order they appear in the clipboard.

This means it is absolutely essential that you select the correct files, and that you do nothing to change the order of those files in the view, between the time of the original copy out and the paste tags back into MC.  If you were to change the order of the files before you do the paste, like by clicking a sort header, then the files will be out of order relative to the contents of your clipboard.  And when you paste tags, the contents of those cells will be scrambled.  There is no way for you to detect such a mistake, other than to know what the contents should be. 

If you're afraid, you can create a new field, Actors2, and paste into that.  You can then visually compare Actors2 to Actors, and if satisfied, paste into Actors, or copy Actors2 into Actors.

It's not difficult if you're careful, but if you're not careful, you can shoot yourself in the foot.  Anyway, you've been warned.  :)  Good luck!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #19 on: March 05, 2021, 03:34:45 am »

This done, I still find this an awful idea. I tested on my collection and checked the Removed names... there are some there that I would like to keep on any search, even though I have only one movie with them.
Also, many movies suffer from the Big Star effect: there's one known guy like Daniel Craig plus a bunch of unknowns - result: only Daniel Craig remains.

I think you can consider another approach: create a field called [Lead Actors] and fill it with just the first one or two from [Actors] (usually the list is in order of importance). Then use [Lead Actors] in search/views instead of [Actors].

You can simply define a Computed field [Lead Actors] = ListLimit([Actors],2)

Even this is not ideal, as there are some movies that are just too shiny... too many stars.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #20 on: March 05, 2021, 03:43:31 am »

The problem is it's not really about 1-movie actors, it's "populate the Actors field only with Actors I care about."

Since no db is going to do that, it's a manual process.  And what happens if he ever uses MCR to update his movies again, and it pulls new data from the database?  Oops!

So yeah, I don't see a long term positive outlook for this endeavor.  Which is why I was content to let you and Glynor chase it.  ;)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #21 on: March 05, 2021, 04:00:37 am »

Example: Dancer in the Dark
Actors: Björk, Catherine Deneuve; David Morse; Peter Stormare; Joel Grey
after script: Catherine Deneuve; David Morse; Peter Stormare; Joel Grey

It takes out the lead actor... unless you happen to have other Music Videos with her.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Database Experts: Remove Actors With Only One Title
« Reply #22 on: March 05, 2021, 04:03:10 am »

What wer said..
I tried to achieve this also many years to go. My conclusion was that relational db would be needed to reasonable achieve this. Maybe there are more clever heads now here who can figure this out with what MC got.

Hard deleting actors with script also causes problems with new "stars". Everybody needs to start with first role and get deleted by script :D
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #23 on: March 05, 2021, 04:08:27 am »

There are lots of actors who were the main star of their big movie, but you'd only have one of their movies in your collection: Anthony Perkins, Marlee Matlin, Linda Blair, Paul Hogan, George Lazenby, etc etc.  Imagine taking them out of the credits for those movies...
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Database Experts: Remove Actors With Only One Title
« Reply #24 on: March 05, 2021, 04:11:10 am »

So you only have Crocodile Dundee in Los Angeles  8)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #25 on: March 05, 2021, 04:14:06 am »

Well, I would remove Anthony Perkins, that guy is a psycho.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Database Experts: Remove Actors With Only One Title
« Reply #26 on: March 05, 2021, 09:43:25 am »

I just got back to this and a lot has happened. I didn't get to test my original idea last night (which now seems like, from skimming the thread, that it wouldn't have actually helped the OP at all anyway) because I found a hard drive dead and was spending hours and hours in fruitless data recovery efforts.

In any case, I just tested it now, and zybex is right. ~limit does NOT seem to be working "correctly" with [Actors] (and probably other List-Type fields). It uses the full string, and not the individual list-type entries (which is really stinky and hopefully they can fix that).

I was able to do exactly the thing I described, and it "worked" but because ~limit doesn't consider each list-type entry separately properly, my resulting View was tiny and only contained a handful of files which had exactly-matching [Actors] lists (multiple copies of the same movie mostly, like 3D and non-3D versions, different editions of Star Wars, etc).

I will note: The reason you were getting huge results with nearly all of the entries in your Library is because EMPTY matches any other EMPTY result when you do an ~expand. Pretty much any time you use ~expand you MUST first filter out -[Field]=[] before the expand, or else it will match ALL other files (even music tracks and photos and all kinds of other crazy stuff) which have NO entry in the given field.

I think you've all moved beyond this, but it is very interesting to know that this (otherwise extremely useful ~limit in a Smartlist, then Expand in a View trick) doesn't seem to work right with List-Type fields. I also wonder now if my existing One-Hit Wonder Detector lists would not work properly with multi-artist tracks. Probably not, though they're probably rare enough in my Library (and rarer still that they're the only track rated highly) that it doesn't substantially impact my results. I also generally do that trick using my [Artist Album (Smart)]* instead of using [Artist] directly so that probably saves me in this instance.

* Which is my version of [Artist Album (Auto)] which never results in "various" and always just spits out the first listed [Artist] instead.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #27 on: March 05, 2021, 12:49:49 pm »

Wow, I'm impressed what you guys all come up with... I have tried the VB script last night, but because I'm not that dumb first renamed my German column ('Darsteller/in', not found in your English speaking script... ;-) into 'Actor'... I wonder, should this be singular, or plural 'Actors' as per script? Pls advise... 

Anyway I used singular, the script ran as desired, and within seconds returned the "Want to Cleanup?" (forget how many it found) and "Done" messages. However, I spotted some flaws, line breaks etc in some actors' fields, so will go fix these first, then run the script again...

Not toooo worried about that, now that I know how it works... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #28 on: March 05, 2021, 01:57:56 pm »

- result: only Daniel Craig remains.

Gosh, we wouldn't wanna have that...! ;-)

Quote
You can simply define a Computed field [Lead Actors] = ListLimit([Actors],2)

I like this idea -- for what I really need the removal effect is less within MC (don't mind the number of actors there at all, plus they're all backed in the description field for searching). No, the original idea was to slim the amount for my DNLA views, where I might occasionally search for movies by actors, A to Z...

The problem is, my device (network TV) can only display up to 1,008 items (63 pages at 16 each), so with +10,000 entries altogether I never get to see the full database, which is pretty lousy...

Do you think that "[Actors] = ListLimit([Actors],2)" (with '2' or a higher number) could be used to narrow the database sent to DLNA so I get to browse the full A - Z ? In other words, how to make a filter "actors with at least 2+ movies" for a media network view?

As always, thanks very much ahead for all your help ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #29 on: March 05, 2021, 02:11:46 pm »

~limit does NOT seem to be working "correctly" with [Actors] (and probably other List-Type fields). It uses the full string, and not the individual list-type entries (which is really stinky and hopefully they can fix that).

@ Glynor -- have you noticed my earlier post, saying that:
 
... there IS a major difference between the 'Artist' and 'Actor' fields; while both are the 'semicolon delimited list' type, the input type for 'Artist' is 'Standard', for 'Actor' it is 'List'...

Album artists are also 'list input', so a result, each file/title can have only 1 artist to it, but a limitless number of actors! That should make a difference when using your trick... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #30 on: March 05, 2021, 02:16:56 pm »

Quote
Do you think that "[Actors] = ListLimit([Actors],2)" (with '2' or a higher number) could be used to narrow the database sent to DLNA so I get to browse the full A - Z ? In other words, how to make a filter "actors with at least 2+ movies" for a media network view?
Nothing like trying! It will certainly narrow it down, even if you have to limit it to just 1 lead actor per movie.

Quote
As a result, each file/title can have only 1 artist to it, but a limitless number of actors! ;-)
No, you can still have multiple artists, just separate them with ";" manually. The Input Type only controls the UI behavior - with List you get a dropdown of known values with checkboxes, and with Standard you don't - but if the Field Type is List, then it's handled as a List internally.

Quote
In other words, how to make a filter "actors with at least 2+ movies" for a media network view?
This was your original request.
Why not connect an HTPC to your TV and run an MC client on it? :-) DLNA for movies kind of sucks on TVs.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #31 on: March 05, 2021, 02:42:27 pm »

I see, thanks... In terms of "[Actors] = ListLimit([Actors],2)", can I use th English expression as well, although my UI is set to German? I'm afraid when using my "Darsteller/in" field, the slash might cause odd results...

I have my TV and laptop PC connected both via HDMI and LAN cable, but prefer to watch movies via LAN (DLNA), because the TV has a much stronger graphics card than my laptop PC has... So watching via HDMI would 1) put all rendering load on my laptop, and 2) not allow me to use the TV's remote control, which is very handy while using the PC for other stuff, such as this forum... ;-)

Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #32 on: March 05, 2021, 02:58:05 pm »

You can use the field's Name or the Display name on expressions. MC recognizes both.
You can change the Display Name to whatever you like.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #33 on: March 05, 2021, 03:31:31 pm »

That is great to know, thank you! So will create such a filter and come back later with results... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #34 on: March 05, 2021, 06:12:17 pm »

So here we are...

1) The VB Excel script worked fine as before (~6,300 actors out of 10,300 removed, not bad... ;-); but my first attempt to paste the edited cells back into MC failed. I used Ctrl+V on the very same list, with the exact same selection I had just copied (~4,340 rows), but there was no change, no message, nothing happened at all... What has gone wrong?

2) Unfortunately, the other idea to use the "[Actors] = ListLimit([Actors],2)" on a DLNA view failed as well... The expression was not recognized, but transformed into multiple custom fields... My mistake, for you meant to create a 'computed field' using that expression -- but what will that field do?

Sorry for having to ask your advise again...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #35 on: March 05, 2021, 07:06:38 pm »

I used Ctrl+V on the very same list, with the exact same selection I had just copied (~4,340 rows), but there was no change, no message, nothing happened at all... What has gone wrong?

What went wrong is you didn't pay attention to my post about Paste Tags. :)  Please go back and read it.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #36 on: March 05, 2021, 08:00:46 pm »

"Paste tags" is one of the edit commands on the right click menu. I'm sure you'll find it if you look. It has a dialog when invoked, which will explain the rest of my comment.

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

Well, I did use the right click menu Edit > Paste (which is equal to Ctrl+V as far as I know), but in the topic you llinked above it says the feature is invoked by 'Ctrl+SHIFT+V' -- this bit of information was missed in your comment... ;-)

But never mind, I realize that I don't really wish to reduce the number of actors within the library, but only in my media network views (as far as actors based ;-). Sorry I hadn't thought of that in the first place...

This being said, can we look instead how to filter the "one-title-only-actors" from my media network views? That would be the perfect solution... Zybex had made a suggestion, but I don't understand how it works...



Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Database Experts: Remove Actors With Only One Title
« Reply #37 on: March 05, 2021, 08:35:09 pm »

Well, I did use the right click menu Edit > Paste (which is equal to Ctrl+V as far as I know), but in the topic you llinked above it says the feature is invoked by 'Ctrl+SHIFT+V' -- this bit of information was missed in your comment... ;-)

No, there was no "bit of information" missing from my comment.   :)  What was missing was you paying attention.  Learning how to do more advanced things can be difficult, so paying attention is important. Look at the quote you yourself just referenced in your post:

"Paste tags" is one of the edit commands on the right click menu. I'm sure you'll find it if you look. It has a dialog when invoked, which will explain the rest of my comment.

"Paste tags" is one of the edit commands on the right click menu. I'm sure you'll find it if you look.

I repeatedly said to do a "Paste Tags".  But instead you decided to do a "Paste".  And this after you asked what "paste tags" was, because you obviously thought it was different from a regular "paste".

I honestly don't know how much more explicit I could have been. If you had your eyes open when you looked at the "edit commands on the right click menu" you would have seen what's highlighted in the screenshot below, exactly as I described it.  :)  Now with this change in direction, it's too bad Zybex wasted his time doing that code. I'm going to pass on the DLNA view adventure.  I'm sorry our attempts to help weren't successful.  Good luck.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #38 on: March 06, 2021, 03:30:00 am »

Doh, now you've annoyed Wer  ::)

VBA code effort is still worth it, as it can be used for other tasks in the future.

Andrew, I don't know where DLNA gets the list of actors from. It could be sent directly by MC in response to some DLNA request, or the TV is just pulling all files with metadata and building the list itself - I don't know how that works. Either way, I think it's likely that the "Actors" field is special, and putting a smaller Actor list in some other field will just probably get ignored by the TV. You'll have to do some tests (or research) to figure out where the names are coming from, and then see what can be done to limit the list.

As for the ListLimit(): create a new calculated Field called "Lead Actors" with Expression set to "ListLimit([Actors],2)". The English names of fields should still work.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #39 on: March 06, 2021, 06:31:05 am »

Hi guys, I just discovered why the 'Paste Tags' command was not found in my Edit context menu -- for whatever reason the item is disabled (greyed out, barely visible) in my 25.0.10 version of MC... and Ctrl+Shift+V won't work either... Bad luck, so sorry @ wer, maybe I should wear stronger glasses at night... ;-)

Any idea how to enable that command? It IS there, so should be made available somehow...

But thanks @ Zybex for illustrating the specific expression, and where to put it, for the new 'lead actors' field! That was the kind of thing I had looked for all along, hope it does the trick for my actors-based network views...

Will test that and report later today! ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #40 on: March 06, 2021, 06:35:34 am »

It's not available on Thumbnail view. You need to change the List Style to "Details" on the View/Playlist (to view it as text columns)
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72444
  • Where did I put my teeth?
Re: Database Experts: Remove Actors With Only One Title
« Reply #41 on: March 06, 2021, 07:04:55 am »

Hi guys, I just discovered why the 'Paste Tags' command was not found in my Edit context menu -- for whatever reason the item is disabled (greyed out, barely visible) in my 25.0.10 version of MC... and Ctrl+Shift+V won't work either... Bad luck, so sorry @ wer, maybe I should wear stronger glasses at night... ;-)
25.0.10 is a very old version.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #42 on: March 06, 2021, 07:10:22 am »

It's not available on Thumbnail view. You need to change the List Style to "Details" on the View/Playlist (to view it as text columns)

+ "It's greyed out if you're viewing a Smartlist or Playlist. It's available if you're on a View." (as per notifiy email)

Talking about a regular view, no play/smartlist, display style is 'Details', but bloody menu item still greyed out...

Never mind that for now, should the 'lead actors' trick work out, then I'm set... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #43 on: March 06, 2021, 07:14:54 am »

25.0.10 is a very old version.

True, that's why it suits me... ;-) I stick to it for two reasons: a) It is the last version before media network settings were updated in a way that broke my random sorted views (discussed in another thread); and b) because I'm not using MC for television or streaming at all, which is what most newer versions are all about, so... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #44 on: March 06, 2021, 07:15:33 am »

Try selecting 1 or more files first.
You're on v25.0.10, but there's v25.0.115 available, with MANY bug fixes since build 10. And, we're up to v27 now... even more fixes. It something doesn't work for you on your current version, there's nothing we can do.

https://wiki.jriver.com/index.php/Release_Notes_MC25
https://wiki.jriver.com/index.php/Release_Notes_MC26
https://wiki.jriver.com/index.php/Release_Notes_MC27
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #45 on: March 06, 2021, 07:20:13 am »

Try selecting 1 or more files first.

Obviously, always tried on the exact selection, in the exact same order etc etc...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #46 on: March 06, 2021, 08:34:17 am »

Ooops, "Topic moved" -- glad I didn't give away my 'very old' version too soon... (not deemed necessary as my first questions were not version related, or so I thought, which is also why I posted in the latest forum... ;-)

In terms of updating, I keep following MC's development, reading about new features etc, so will eventually buy once there is a feature I need... ;-)

On another note, I may have found why the 'Paste Tags' item is disabled. On the "Tagging Mode" wiki page, it says "Select a View Scheme in the tree (you must select the Parent, not Child of the Scheme)."
In fact, my testing view was nested in another -- so even while not in (column) tagging mode, this may have blocked tag pasting... (some things ain't what they really seem... ;-)

Will try moving the view to repeat the process... and post results for any one still interested... Thank you! ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #47 on: March 06, 2021, 11:49:55 am »

Sorry to say, but nothing works...

Approach #1 -- The expression ListLimit([Darsteller/in],2) (with 'Actors' replaced by my custom* German name) has reduced the total number of actors "by 4" (from 10,386 to 10,382). Not the desired effect...
* I'm not using the original actors field because MC will display all of its entries in the title hover preview ('description'), making it too large in some cases... one of the many details we have not yet considered...

Approach #2 -- As for pasting of tags, I have moved my 'testing view' to the parent 'Video' branch of the tree. This view is 'file list' based only, has NO categories, and only my custom "Darsteller/in" column visible. Yet the 'Paste Tags' menu item remains greyed out (disabled).

I would be happy for either of the two issues to find a solution -- no matter which as both aim for the same goal... ;-)

Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Database Experts: Remove Actors With Only One Title
« Reply #48 on: March 06, 2021, 12:36:08 pm »

Andrew, I mentioned the DLNA issue already. You have lists of actors in several fields - Actors, Darsteller, Lead Actors, whatever. Now, how do you know which one of those fields is displayed by the TV? ListLimit() is creating a shorter list of actors, and then placing it on a separate field; but... why would the TV see that field automagically? It doesn't work like that. I would expect the TV to display the contents of the hardcoded [Actors] field, not anything else. Certainly not any non-standard field. So unless you're willing to do proper tests, this won't go any further. I suggest you create a blank database, add 5 or 10 movies, and play around with the Actors to see exactly what is reflected on the TV view.

As for #2, pasting tags, no one here will there's no point wasting time trying to find out why that doesn't work on v25. At least try upgrading to the latest available v25 version.
Logged

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Database Experts: Remove Actors With Only One Title
« Reply #49 on: March 06, 2021, 01:32:17 pm »

Now, how do you know which one of those fields is displayed by the TV? ... why would the TV see that field automagically? It doesn't work like that. I would expect the TV to display the contents of the hardcoded [Actors] field, not anything else. Certainly not any non-standard field.

(...)

As for #2, pasting tags, no one here will waste time trying to find out why that doesn't work on v25.

Outch, that hurt... I can't believe you've never used the media network options of MC? But no problem, you've helped me along, so I'm happy to tell you: In MC's options, if you click the tab 'Media Network', then "Add or configure DLNA servers" and "Customize views", you will find the very same ways to create views as you do within MC. You can even import existing library views, and change them in every way possible. There is nothing 'hard coded' at all, they use the exact same search & filter wizard like your regular MC views. (Default views are already set up for DLNA, and under 'Advanced > Customize views for JRemote/Panel/MCWS', respectively.)

In terms of #2, what if I asked you, "how does it work in the latest version?" instead? (Sorry, trying to be smart again... Honest, I didn't know that older versions are excluded from 'Is this support'... ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)
Pages: [1] 2   Go Up