INTERACT FORUM

More => Old Versions => Media Center 17 => Topic started by: MrC on November 18, 2011, 11:30:43 pm

Title: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 18, 2011, 11:30:43 pm
The Options > File Locations settings for various media types generally define the default location templates/rules for media.  And the Rename, Move & Copy dialog templates/rules typically need to be updated to mirror those settings.  When working with different media types, selecting the correct rules is tedious.

It might be useful to allow this dialog to pull and pre-fill the values from File Locations.  The modified screenshot shows the idea.  A new pulldown allows the user to select any of the media types specified in File Locations.  When a media type is selected, the Base path, Folder rule, and Filename rule from File Locations would be pre-filled from the corresponding media type in File Locations.

Once any of Directory Base Path, Rule, or Filename Rule is changed, the pulldown would be reset to a value, such as Custom to indicate non-default rules are currently set.

Alternatively, previous values which are currently not-media specific, could be managed as media specific sets.  The media type pulldown then would select the media-specific set, establishing the list of previously used values the user sees today, plus a new value called "Default (from File Location)" which would pull the corresponding default value from File Locations for this set's media type.  In other words, the pulldown values would be Audio, Video, DVD Video, etc.  When one of these is selected, the list of recently used items for that media type replaces the current recently used list.  Thus, media-specific settings are retained, and the default value from File Locations can always be used if "Default (from File Location)" is selected for any of Base Path, or any of the Directory or File rules.

If there is interest, I can create additional mockups.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: Matt on November 19, 2011, 08:05:12 am
It's a good idea.

Each expression editor does offer most-recently-used items, but it'd be better if you could save and load presets for the whole dialog, including presets from Options and most-recently-used items.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: rjm on November 19, 2011, 10:05:53 am
This would be a great improvement. If there isn't time to implement it perhaps a smaller change could be considered. I frequently make typos that end up in my frequently used lists. I don't want to clear the whole list because the other items took a while to create and are valuable. I've tried editing the registry but I do not understand the format of the MRU lists.

Perhaps the delete key could be used to remove unwanted items from MRU lists?
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: JustinChase on November 19, 2011, 11:55:01 am
It's a good idea.

Each expression editor does offer most-recently-used items, but it'd be better if you could save and load presets for the whole dialog, including presets from Options and most-recently-used items.

It's a GREAT idea.  I've been working on re-organizing my actual media on the disk a lot recently, and silently wished for this.  The recent is helpful, but if one uninstalls MC for any reason, all of those are gone.  Also, sometimes I have similar needs, and I have to really pay attention to make sure I pick the right one from that list. 

I also wish
...the delete key could be used to remove unwanted items from MRU lists?
for the very same reasons
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 19, 2011, 12:03:54 pm
While I agree that a more capable dialog would be the best solution, you can essentially accomplish the same thing with a few well-crafted calculated custom fields.

I'm working on a HowTo post about this right now, but it'll take a bit longer.  Keep your eyes out next week.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 19, 2011, 12:47:45 pm
While I agree that a more capable dialog would be the best solution, you can essentially accomplish the same thing with a few well-crafted calculated custom fields.

.... but a) you have to copy/paste them (and remember to do so on each modification) from File Locations, and b) nested expressions are much more difficult for users to parse/read (which is a non-starter for most).
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: lise on November 21, 2011, 05:56:38 pm
I would also love to have have a drop-down for "base path".
Music goes in \\HTPC\Media\Music
Docs go in C:\Users\Name\Documents
Pictures go in \\HTPC\Media\Pictures

See what I mean? I'm constantly going from the htpc to my local drive.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 21, 2011, 06:03:05 pm
The proposal would be to maintain groups of presets (both LRU and from Options), on a per-media type basis.  Selecting the Audio preset would reload your settings relevant to Audio (which would reload the recently used list for audio, and the Audio settings from Options > File Locations).  Likewise, the Images preset would reload the images-related settings.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: Alex B on November 21, 2011, 06:33:07 pm
I would also love to have have a drop-down for "base path".
Music goes in \\HTPC\Media\Music
Docs go in C:\Users\Name\Documents
Pictures go in \\HTPC\Media\Pictures

See what I mean? I'm constantly going from the htpc to my local drive.

Déjà vu...

From the topic: NEW: Rename Files From Properties can now make new copies of files at the target
... In addition, it would be nice if the Base Path box could store a few recently used strings and make them available in a drop-down menu.

And from the 12.0.489 thread: http://yabb.jriver.com/interact/index.php?topic=46402.msg318094#msg318094
Quote
Re: Media Center 12.0.489 by Alex B
« Reply #3 on: April 30, 2008 »

... In addition, could you please finally add a drop-down list for the recently used base paths? It would be even more important now because the base path is likely to be altered when files are copied or moved to a single named folder (instead of using the now removed Move/Copy Disk Files tools).

 ;)
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: gvanbrunt on November 21, 2011, 07:23:57 pm
Count me as +1. I constantly have to type or Browse to base paths. I also have this same issue in the import dialog (manual)...
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 23, 2011, 11:22:42 am
.... but a) you have to copy/paste them (and remember to do so on each modification) from File Locations, and b) nested expressions are much more difficult for users to parse/read (which is a non-starter for most).

I'm using nested calculated fields to make this much more manageable.

It is working well, I'm just not done.  I'm hoping to make a concerted push this weekend and get the whole process documented with some screenshots and everything.  I've already done the same thing for my Theater View captions, and it is working great and is easy to manage when you want to make changes.

I just wish we had that IsViewMixed() expression I asked for...  :-\
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 23, 2011, 11:26:06 am
Déjà vu...

I agree completely.  We've been asking for this for a long time.  I remember a bunch of those old threads (and others).

I think it'll come sooner rather than later now.  Or I hope so anyway.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 25, 2011, 11:01:53 pm
Darn... My plan for the nested calculated fields doesn't work for the Rename, Move, and Copy Tool.  That tool evaluates the incoming fields and strips out characters not allowed by the filesystem and replaces them with underscores (I knew this), but it also strips out the "\" character.  Of course, that makes sense, or AC\DC would end up in a nested DC folder.  I just didn't think about that before.

Too bad.  The plan works brilliantly for Theater View Captions.  It just won't work for the Renamer tool at all.

So.... Yes, even more of a reason that we need this stuff.  My text file on the desktop is getting old.

PS.  I really should have tested it in that tool before I got so far along.  I was using my "Expression Tester" view, and just looking at the results of the field in a column up until then, while I built all the different expressions I'd need.  That's three hours or so of my life I won't be getting back.

Hmmm... Unless I use \\?  Maybe, let me try it.  Nope.  You can't escape the check either, it appears.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 25, 2011, 11:21:54 pm
have you tried replace() ?

http://yabb.jriver.com/interact/index.php?action=printpage;topic=61674.0 (http://yabb.jriver.com/interact/index.php?action=printpage;topic=61674.0)
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 25, 2011, 11:25:28 pm
have you tried replace() ?

http://yabb.jriver.com/interact/index.php?action=printpage;topic=61674.0 (http://yabb.jriver.com/interact/index.php?action=printpage;topic=61674.0)

No, good find.

Perhaps it will work then.  It makes the expressions you enter MUCH uglier though.  I don't know how happy I am about that.  I was hoping this would be something that mere mortals could accomplish if they had a tutorial and a set of "stock" expressions to start with.

I might re-work it to use that, though.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 25, 2011, 11:30:11 pm
Yep.  That appears to work.

I might still do it, since most of the work is done now.  I'm using {F} as the folder separator, which seems extremely unlikely to be actually ever used in a filename, but that would be (of course) the caveat.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 25, 2011, 11:53:53 pm
Huh!  Check this out...

I thought I'd be clever here.  Since Replace() works, it appeared at first that using expressions in Rename, Move, and Copy somehow avoids the disallowed characters check.  Now, this actually could be dangerous if it were true, because you could then feed it actual disallowed characters.  But that doesn't appear to be what's happening.  Instead, there seems to be some special handling of the Replace() expression explicitly.

Anyway, at first I thought I'd be clever and just use If(1,[Renamer Directories]) to "protect" the rules from having their \ characters stripped.  It dawned on me that this might not be a good idea, but I wanted to try it out anyway.  It didn't work, the characters still get stripped.  But, I found some really weird behavior of the If() expression, so I thought I'd mention it.

To reproduce this, follow these simple steps:

1. Create a new calculated field called [Test] with this as the expression:
[Media Type]\[Media Sub Type]\[Series]\[Season]\

2. Find a file that has a [Series], [Season], and [Episode] tagged, and then open the Rename, Move, and Copy tool on that file.

3. Paste If(1,[Test]) in the directories box.  The output from this expression is always "1".  If you paste in If(2,[Test]) then the output is always "2".  It shouldn't be that way, since 1 is the test, and 1 is always true.

4. Now, paste in this instead If(1,[Test],0).  This works like it should (it outputs the results of the [test] expression except that it strips the "\" characters).

For some reason, this particular If() statement, when used in the Rename, Move, and Copy Tool (at least) seems to require a negative result parameter to work properly, even though that parameter is supposed to be optional.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 26, 2011, 12:10:16 am

3. Paste If(1,[Test]) in the directories box.  The output from this expression is always "1".  If you paste in If(2,[Test]) then the output is always "2".  It shouldn't be that way, since 1 is the test, and 1 is always true.

This can be duplicated even easier: If(2,x) in an expression column.

If() requires three arguments, so the statement is one short.  The parser is a little loose when this happens (sorry Matt).
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 26, 2011, 12:18:00 am
If() requires three arguments, so the statement is one short.  The parser is a little loose when this happens (sorry Matt).

I'm pretty sure the negative output part If() was always listed as optional in the documentation, and I think it is intended to be optional.  The wiki seems to have changed the formatting.  When it was first built (based on the old header files we used to have), I think it used italics for the parameters that were optional, but now it seems to just use italics for every other parameter.

Either way, I'm pretty darn sure this has long-been an optional parameter (or was supposed to be), but perhaps my memory is shot.  I know using it that way works much of the time.

EDIT:  Perhaps I should fix my [Theater View Caption] set of expressions, because they depend on If() statements that are missing their third parameter.  They work, but if it isn't really optional in all cases, then using it might be a bit sketchy.  It isn't hard to add an extra comma, of course, but that makes it less human-readable.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 26, 2011, 12:28:38 am
You could be right.  Yet, according to the wiki page as of Jan 7, 2007, all 3 arguments were required:

http://wiki.jriver.com/index.php?title=Media_Center_expression_language&oldid=2562#If.28....29:_Outputs_different_values_depending_on_the_value_of_the_first_parameter. (http://wiki.jriver.com/index.php?title=Media_Center_expression_language&oldid=2562#If.28....29:_Outputs_different_values_depending_on_the_value_of_the_first_parameter.)

There is some inconsistency in the italics throughout the expression page.  Some functions use an alternating normal/italics/normal format, others just standard.  I'd like to standardize it to typical technical documentation standards, such as italics for placeholders or minor emphasis, but not as a general sentence style.  But I don't want to step on Marko's toes and hard work.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 26, 2011, 12:33:47 am
http://wiki.jriver.com/index.php?title=Media_Center_expression_language&oldid=2562#If.28....29:_Outputs_different_values_depending_on_the_value_of_the_first_parameter. (http://wiki.jriver.com/index.php?title=Media_Center_expression_language&oldid=2562#If.28....29:_Outputs_different_values_depending_on_the_value_of_the_first_parameter.)

There is some inconsistency in the italics throughout the expression page.  Some functions use an alternating normal/italics/normal format, others just standard.  I'd like to standardize it to typical technical documentation standards, such as italics for placeholders or minor emphasis, but not as a general sentence style.  But I don't want to step on Marko's toes and hard work.

I guess my memory is shot then.  I might be thinking about the MCC documentation, which I helped build way back when.  More consistency would be better, I think, and I doubt Marko would mind something simple with the formatting like that.

Anyhow...

I guess I need to fix those [Theater View Caption] expressions.  Like I said, they work, but better safe than sorry.

Thanks for the help!  I'll have to decide if doing the {F} thing is worth it.  I'll probably do it for myself anyway, but I don't know that my tutorial will be as helpful to others as it would have been.  I'll probably base it on the [Theater View Caption] expression set I've made, and then just comment about how the same method can be used for Rename, Move, and Copy if you're careful of the Replace() stuff.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: Matt on November 30, 2011, 02:57:49 pm
Next build:
NEW: Rename, Move, & Copy Files tool adds a 'Preset...' button that supports loading settings from Options > File Location, loading / saving user presets, and copying / pasting settings (for sharing with other users).
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 30, 2011, 03:40:29 pm
Next build:
NEW: Rename, Move, & Copy Files tool adds a 'Preset...' button that supports loading settings from Options > File Location, loading / saving user presets, and copying / pasting settings (for sharing with other users).

Ahhh, more goodies...
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on November 30, 2011, 04:12:38 pm
Next build:
NEW: Rename, Move, & Copy Files tool adds a 'Preset...' button that supports loading settings from Options > File Location, loading / saving user presets, and copying / pasting settings (for sharing with other users).

 :o :o :o :o

I'm glad I got lazy and didn't finish.  ;)
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: gvanbrunt on November 30, 2011, 06:20:47 pm
Woot!
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: MrC on November 30, 2011, 06:23:05 pm
This is pretty cool.

A couple of future feature additions would be nice:

1) Base path maintains recent paths
2) Recent items list per-preset.

Otherwise, thanks!
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: gvanbrunt on November 30, 2011, 06:32:16 pm
Since we are looking at this, an important enhancement/bugfix would be for moving supporting files. There is no real reason (that I can think of) not to move the image (cover art) file since it 's location is listed right in the db. As it stands it breaks the cover art if you move files. Other important supporting files like subs would be nice too.

And there is a "bug". I just finished moving several hundred movies. Aside from moving the above mentioned files by hand, any DVD folders (Video_TS) only had one file moved. The rest were left behind.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: Alex B on December 01, 2011, 06:47:22 am
Since we are looking at this, an important enhancement/bugfix would be for moving supporting files. There is no real reason (that I can think of) not to move the image (cover art) file since it 's location is listed right in the db. As it stands it breaks the cover art if you move files. Other important supporting files like subs would be nice too...

Here is my recent reply from the public MC17 board:

Understandably MC has only information of the files that are included in the library (a cover art file like folder.jpg exists only as a part of the media file's metadata).

It is possible to import also the cover art image and other files (like a rip log and additional image files) that may exist in the media files' folder, but they would need to be tagged with appropriate tags and included in the selection with the media files before all files from a folder could be moved as one unit.

An option to move also "non-library" files that may exist in the files' folders has been requested from time to time. However, implementing it would not be trivial. Depending of the used rule it is quite possible that not all files from a single folder go to some other single folder. They may go to two or more separate folders or some of the files may intentionally remain in the original folder.

A possible implementation for this option would move any remaining files together with the last moved file from each included source location. It would then be up to the user to make sure that using the option would make sense and work as desired.

Foobar2000 has this feature. It can optionally move all remaining files from the source folder to the new folder. If used carelessly the feature can do unintended things, but when it is used for moving full albums to a new folder structure (a new single folder for each audio album and the supporting files) it works fine.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on December 01, 2011, 07:55:41 am
Foobar2000 has this feature. It can optionally move all remaining files from the source folder to the new folder. If used carelessly the feature can do unintended things, but when it is used for moving full albums to a new folder structure (a new single folder for each audio album and the supporting files) it works fine.

I don't have a strong opinion, but rather than an optional "move the rest of the crap" checkbox, I think it would be best for MC to handle only:

1. Files in the library.
2. Auxiliary files it "knows about" and can use, such as sidecar XML, comskip, image, and Subtitle files that have matching filenames.

I often have a bunch of detritus in my new imports folders that I don't care about (Sage generates properties files, for example).  It is convenient to be able to use the Rename, Move, and Copy tool to move the stuff I care about to the "final" destination, and then I can just delete what is left.

Right now, for sidecar XML files I just ignore it because MC can regenerate these easily.  For subtitle files I basically always remux these into a new MKV file (but this isn't a huge hardship because I don't heavily use subtitles since I'm a native english speaker and my whole family can hear fine), so that's not an issue.  My main issue is sidecar image files.

Currently, I usually either add these to the library and tag them to match the main files (I have a "Media Art" integer field that is used to hide the files from most views), or I decide I don't care and delete them.  That's my main issue.  I haven't messed with comskip yet, but I'm planning to try that out soon (I was originally waiting to finish switching to MC for PVR duties, but I'm putting that on hold for now).  I can pull this workaround (adding to the library) off but it requires a bunch of custom views and fields and it doesn't seem like a workaround that is appropriate for a general user.

In any case, I think something "smarter" would be better than a "move all the crap" option.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on December 01, 2011, 08:04:29 am
This is also not exactly the same thing, but I think it is related and should be handled probably at the same time....

I would also REALLY like to see better handling of Renaming, Moving, and Copying Stacked files (and general file naming of those stacked files).  Right now, if you use the Conversion support in MC to create lower-quality versions of existing files, the filenames can get ugly unless you store them in a separate segregated directory structure.  I'd prefer to have MC keep stacked files right next to their source files.  But, if you have a high-quality file, and you create a lower quality stacked file for handheld or whatever and that resulting file is of the same type, then the filenaming gets ugly and stuff can get lost.

I see this often with MP3s (I use the option to convert high bitrate files to the "HQ Portable" setting for transferring to my phone), JPEGs (I create and stack web quality versions of original 12 mpixel images sometimes), and especially with MP4 video files (again, for portable use).

While you can stack the files in MC, you are basically on your own to manage the file naming.  I think some automated mechanism where the stacks can get labeled with "-portable.mp4", "-lowres.jpg", or something like that instead of whatever the filesystem decides to do with duplicates.

That, and it would be nice to have an option in the Rename, Move, and Copy tool to "protect duplicate filenames" somehow (where on-move, if the rule you implement creates duplicate file names, it warns you, and provides the option to serialize them systematically instead of trying to overwrite or whatever).
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: bspachman on December 01, 2011, 01:09:13 pm
Quote
I would also REALLY like to see better handling of Renaming, Moving, and Copying Stacked files (and general file naming of those stacked files).

+1

When you delete a stacked file from the library, there's always a checkbox to 'delete the whole stack'. Perhaps a 'rename and/or move the whole stack' function could be implemented in conjunction with a suffix (perhaps something generic like '-stack1', '-stack2', etc.)

Right now, I manage all my stacks manually instead of using the handheld conversion tools to help me minimize my confusion, but I would like to keep stacked files next to their originals....

brad
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on December 01, 2011, 01:24:23 pm
perhaps something generic like '-stack1', '-stack2', etc.

That would work for me.
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: darichman on December 01, 2011, 08:48:18 pm
For me:
  - rename/move/copy operations affect all files in a stack
  - rename/move/copy operations intelligently handle DVD/Blu-ray volumes (VOBs, IFOs etc)
  - rename/move/copy operations intelligently handle single file cues (might be fixed already, I got rid of all these!!)
  - an option to move auxiliary files in the same folder (maybe off by default each time to avoid unintentional messes)

Use of rename/move/copy presets is a wonderful addition. I can't wait to use this one :)
Title: Re: Feature Request: Rename, Move & Copy Files...
Post by: glynor on January 25, 2012, 09:27:37 pm
Jim, can you move this thread to the public forum so that I can link it to EpF's nice Rename, Move, and Copy Files tutorial (http://yabb.jriver.com/interact/index.php?topic=69495.0)?

Thanks.  A bunch of the background in this thread might be handy for people using that tutorial.

I was planning to do the same thing, but since the rename() thing was necessary, I didn't ever bother.