INTERACT FORUM

Please login or register.

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

Author Topic: Advanced editing of "description" field  (Read 5024 times)

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Advanced editing of "description" field
« on: September 25, 2013, 11:41:26 am »

Dear all,
as the subject indicates, I am looking for ways to perform advanced edits of the "description" field, the one that holds all the info displayed in the popup baloon, such as file name & path, year and what else you've entered...

For example: I have hundreds of movie decriptions, auto imported from external sources eg. via "Get Movie & TV info"),  containing manual line breaks, which unfortunately 'blow up' my info baloons beyond comfortable size...
Is there a way - perhaps even using an external editor - to remove all those line breaks, or at least replace them with less space consuming characters such as commas, hyphens etc?

NB: An earlier attempt to manually edit field files (found under "..\AppData\..\Media Center xx\Library", with *.jmd extension) using a text editor only made MC crash upon restart - I gather that .jmd files contain a specific format that external editors will corrupt... any alternatives?

Many thanks in advance!
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #1 on: September 25, 2013, 11:54:01 am »

The Description "field" only contains some of the text you see in the hover balloon.  The contents of other fields are also used.  There is no current means to edit the balloon's template.

You could change the actual "Description" field's text, but there's no easy way in MC to find/replace newlines in such text.  You could export the data via MPL, edit the MPL substituting the newlines in the Description field for whatever you want, and re-import the MPL.  You'd probably want a script to do this.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #2 on: September 25, 2013, 12:07:24 pm »

Thank you Mr C - that sounds like what I need... just what is "MPL"??
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #3 on: September 25, 2013, 12:11:09 pm »

It is an XML file that MC produces / consumes.  File > Export Playlist and select the MPL format.  Be sure to include the Description field in the view for it to be pushed into the MPL.

Tangentially, you can also Copy the file list rows that include the Description column and paste the data into a spreadsheet, but for large fields such as Description, you'll need MC19.  This won't help you get the data back into MC.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #4 on: September 25, 2013, 12:27:27 pm »

Thanks - howeever I wonder if this procedure will not merely produce a new playlist... My view is based on file paths, to display/sort files exactly as stored on disk. Will this be preserved?
And what happens if I remove the playlist after importing the data?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #5 on: September 25, 2013, 12:29:55 pm »

The term "playlist" here is loose.

An imported MPL will overwrite the tags for the files in the MPL.  Create one and take a look.  Edit a small item in the tag's value (it will be obvious when looking at the MPL file), and File > Import Playlist the MPL file.

You're free to remove the imported playlist itself from under Playlists > Imported Playlists.  Consider these as bonus files.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #6 on: September 25, 2013, 01:29:44 pm »

Sure this method will overwrite existing library data? I mean, MC not just has to add the new MPL data but also check the entire library if and what data already exists, I guess based on a given "file name" field...

Besides, what happens with the other lines of the MPL should I choose to replace all line breaks (let alone that not every text editors supports this)? For example, compare these few lines, before and after editing (note the line breaks between opening/closing tags, here shown as '|'):
  (before:) ... <Field Name="Media Sub Type">Movie</Field> | <Field Name="Country">FR</Field>
  (after replacing all line breaks with comma + space:) <Field Name="Media Sub Type">Movie</Field>, <Field Name="Country">FR</Field>


Will MC still be able to import these data correctly?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #7 on: September 25, 2013, 01:47:48 pm »

I am sure.  I've provided many scripts to do conversion, scape meta-data, etc., which employs this method.

MC compares the Filename string in the MPL with the Filename field in the Library.

Your script will need to modify only the data in each file's Description's value:

<Item>
  ...
  <Field Name="Description">modify this description value</Field>
  ...
</Item>

And you'll have to properly encode the Description value such that it is proper XML.  It isn't hard, but it certainly is non-trivial.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #8 on: September 25, 2013, 02:31:40 pm »

(Thanks, that sounds convincing ;-)
 But to put this clearer still -- what I would do is open the MPL file in a text editor (I'm using 'EditPad' as it can handle line breaks), then perform "Search & Replace" to replace ALL line breaks by commas, hyphens and/or spaces, in order to obtain a more condensed description text. (All non critical characters I hope? ;-)

However, as no scripting is involved, I will be unable to distinguish which fields (represented as tagged lines as in my example) are modified and which are not.
That's why I wonder if this will mess up the file so MC cannot re-import as desired... What do you think?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #9 on: September 25, 2013, 02:36:45 pm »

No, you can't just replace the newlines in the MPL file.  The MPL must remain valid XML.  You can only edit the stuff inside the Field keys, which are the values (e.g. the modify this description value stuff).  The key you want is the Field key that has the Description attribute (I've shown which one above).

Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #10 on: September 25, 2013, 03:00:11 pm »

OK, and how about other export formats, HTML or CSV (provided of course that MC can import all those formats it can export ;-)
Unlike MPL, I think these even allow you to choose which fields to export, and may be less error prone upon changes...?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #11 on: September 25, 2013, 03:06:29 pm »

You can export these, but only MPL import will perform metadata updates.

I believe I already have a CSV2MPL script you could use, however.  A quick, trivial modification would make it easy to replace the newlines in any given field.  (I honestly can't recall if I have a script that reads MPL, but they all write MPL.).

Really, though, are you sure you want to do this?  :-)
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #12 on: September 25, 2013, 03:16:42 pm »

Well, perhaps rather not, sounds like too much automation with uncertain outcome...
For the time being, manual editing of decriptions gets the best results (not only for line breaks but some other data that I'd like to 'taylor fit' ;-).
Thanks a lot again!
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: Advanced editing of "description" field
« Reply #13 on: September 25, 2013, 03:54:32 pm »

Sorry, here's one more idea:
What happens if I enable the option "Tree & View > Allow clipping of very long fields"? Will this affect the "decriptions" field at all?
If so, perhaps it gets the desired effect to make the hover baloons smaller (without removing any data from the fields of course) by hiding superfluous data from being displayed...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #14 on: September 25, 2013, 04:55:08 pm »

It won't affect the Description field other than for auto-sized Tree items and View columns.  You normally wouldn't have a Description appear in the tree, and the setting isn't too effective for auto-sizing Description in a list.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #15 on: September 25, 2013, 04:59:59 pm »

I'll make you a deal (and I don't work for JRiver).  You upgrade to MC19, and I'll give you a script to do the conversion in one shot.

:-)
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #16 on: September 25, 2013, 05:19:40 pm »

It won't affect the Description field other than for auto-sized Tree items and View columns.  You normally wouldn't have a Description appear in the tree, and the setting isn't too effective for auto-sizing Description in a list.

Right, I might have guessed ;-)
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: Advanced editing of "description" field
« Reply #17 on: September 25, 2013, 05:32:48 pm »

I'll make you a deal (and I don't work for JRiver).  You upgrade to MC19, and I'll give you a script to do the conversion in one shot.

Thanks for your offer but I think that won't do exactly what I want... Now as I'm editing manually I discover many fields just varying too much for a "one shot" solution...

(Also, to be frank since you're not of JR, I wasn't going to upgrade to v.19 because I think v. 18 isn't fully developed. I had posted some comments on that issue elsewhere earlier, especially with respect to the 'new rendering engine' that causes some odd behaviour. I think it's unfair to just implement fixes for an existing release into a new one and force users to upgrade yet again!)
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: Advanced editing of "description" field
« Reply #18 on: September 27, 2013, 02:58:33 pm »

@ MrC --> Just to let you know that I've now tried the export/import MPL process. While it worked as desired in updating my "descriptions", the following was a serious drawback:
Once the new MPL was imported, MC started to renew all my video thumbnails ('Miniaturen' in my German version)... for several hundreds of videos, this is a highly time and CPU consuming procedure that I had rather avoided by all means (not to mention that some thumbs had been created at hand selected timings via Options > Tree & View > 'Miniaturen' > 'Create thumbs at XXX seconds')... External thumbs and screenshots used as such are preserved though...

Why doesn't MC simply keep existing thumnail images for videos which remain unchanged in the library? What MC should do at this point is see if a thumbnail exists for any imported file, and preserve all matches, instead of build them all over again from scratch! (I happen to know the same happens when you import another library - what a nonsense!)

I should consider this a bug - but at the very least a huge waste...
(sorry, I keep forgetting you're not JR staff, but there you are ;-)
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #19 on: September 27, 2013, 03:06:26 pm »

I don't know what triggered this.

Perhaps the write to the sidecar file?  I would not have expected an update via MPL to trigger a rebuild of thumbnails or any metadata lookups.  How did you Import the XML?

I don't know what fields you wrote out, so maybe there's some field you don't want to write (write out only the fields you need changed).

If this is a problem, perhaps share a small XML/MPL file that will demonstrate the problem so that someone else can reproduce it.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #20 on: September 27, 2013, 03:58:59 pm »

I'm not using sidecar files at all, since MC usually gets all the metadata I need (plus a few more that I may never need... ;-).
And again, the import went fine and was valid XML. The MPL export was edited in 'EditPad', performing a Search & Replace for this string: "¶ Reg." with " - " (where '¶' stands for line break, and 'Reg.' is short in German for 'Director' as this word followed all line breaks I wanted removed. And as this string did not occur anywhere else, no other field was modified).

You may be right in that some field might trigger rebuilding the video thumbnails, regardless whether a file already exists. Obviously, I was unable to select individual fields (for MPL exports it's unvariably 'all visible fields'), and import just lets you select a file, without any options...
Here's the visible fields in my column view (in left to right order):
"Large thumbnail | Stack icon | Resolution | Year | Country | Title | Rating | Compression | Duration | Channels | Dimensions | File size". Any guesses which may cause the stir?
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #21 on: September 27, 2013, 04:09:07 pm »

Large Thumbnail would be my guess.

But I would delete all from the file that aren't Filename and Description.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #22 on: September 27, 2013, 04:51:29 pm »

Who knows... and I forgot one more field/column which is "Small thumbnail". So either of these could be the cause...
Anyway, should you as 'Beta Team' be in touch with developers, why not secretly add this to their 'to do'list (while they sleep ;-):
"When importing, MC MUST NEVER rebuild thumbnails for existing files!"

Removing unwanted fields is worth a try to avoid new thumbs (since my import completed however I don't feel like another ;-) - but should be done before exporting:
1. create MPL, 2. remove undesired fields/cols from playlist view, then 3. export, edit as needed and import. (With some several hundreds of files, times 8 columns, to delete those sections from the XML would take longer than doing it all manually...).
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #23 on: September 27, 2013, 05:17:41 pm »

JRiver reads all the posts, so they've seen the thread.

Again, though, without having access to a simple MPL that you believe triggers the issue, I'm sure they'll spend no time on this.

The best way to test this stuff is with an MPL that contains a single Item.  You can Backup the library, and always Restore it should something go awry.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #24 on: September 27, 2013, 05:46:01 pm »

It's not me who believes that my MPL was the cause... ;-) It seems pretty clear to me, as I remember the same happened when importing a library, that rebuilding thumbnails is one of MC's importing routines - and one that should be refined.

(And to test if the same happens with any custom view is really a job I don't apply for... ;-)

(BTW, sorry for reiterating your suggestion of a custom view - for some reason that part didn't show in your post (check above... ;-) only in the email...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #25 on: September 27, 2013, 05:57:08 pm »

(BTW, sorry for reiterating your suggestion of a custom view - for some reason that part didn't show in your post (check above... ;-) only in the email...

I deleted it.  I was incorrect about this.  It holds true only for CSV exports or clipboard copy.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #26 on: September 27, 2013, 07:18:20 pm »

Sure? If MPL export includes only those fields found in your view scheme, why shouldn't it work for just two fields?
Maybe we'll never know... I'm quite pleased with the result after all, that spared me a lot of hand work... (I even discover some thumbs turned out nicer than the old ;-)
I stick to my statement however - "MC should create thumbs for new files only", as this will speed up imports by a multiple...
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Advanced editing of "description" field
« Reply #27 on: March 04, 2014, 11:04:39 pm »


Once the new MPL was imported, MC started to renew all my video thumbnails ('Miniaturen' in my German version)... for several hundreds of videos, this is a highly time and CPU consuming procedure that I had rather avoided by all means (not to mention that some thumbs had been created at hand selected timings via Options > Tree & View > 'Miniaturen' > 'Create thumbs at XXX seconds')... External thumbs and screenshots used as such are preserved though...

Why doesn't MC simply keep existing thumnail images for videos which remain unchanged in the library?

Just to follow-up on an old post.  This (thumbnail deletion problem) turned out to be an MC bug that is fixed in a MC19 beta release; users should see the release pretty soon.
Logged
The opinions I express represent my own folly.

andrewberg

  • Galactic Citizen
  • ****
  • Posts: 418
Re: Advanced editing of "description" field
« Reply #28 on: March 05, 2014, 01:25:28 pm »

Thanks, good to know!
Logged
"To be is to do" (Socrates) - "To do is to be" (Sartre) - "Do be do be do" (Sinatra)
Pages: [1]   Go Up