# Sorting without renaming and converting

**URL:** https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271
**Category:** Metadata and Renaming
**Tags:** nextpvr
**Created:** [July 20, 2017, 2:59pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271 "2017-07-20T14:59:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![p37307](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/p37307/32/73_2.png) [@p37307](https://discussion.mcebuddy2x.com/u/p37307)
#### Post date: [July 20, 2017, 2:59pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/1 "2017-07-20T14:59:12Z")

</div>

I was hoping there was a way to sort my series recordings into season folders without renaming or re-converting my recordings.

I use _NPVR_ and my recordings are _SHOWNAME.SxxEyy.SUBTITLE.ext_.  
i.e. CSI.S01E01.Best Of Times.ts (now \*.mp4)

For awhile now I’ve been using _MCEBuddy_ to convert the NPVR recordings to MP4’s without renaming them as _NPVR_ has done a good job naming as I like.

Now I find myself with folders having 100 or more recordings plus their images & NFO files.

What, if any, would be a good recipe _Conversion Task_ to accomplish this?

If this could be done, I would then need to do a custom command call from MCEBuddy to update the NPVR database of the new location. The NPVR program NScriptHelper does this

`NScriptHelper -Rename srcFileName tgtFileName`

So the command would be: `"C:\Program Files (x86)\NPVR\NScriptHelper.exe -Rename G:\_TVdir\Crime Drama\CSI.S01E01.Best Of Times.mp4 G:\_TVdir\Crime Drama\CSI\Season 01\CSI.S01E01.Best Of Times.mp4"` to update NPVR of the new location of file CSI.S01E01.Best Of Times.mp4. I would need to know what the MCEBUDDY before (scrFileName) and post (tgtFileName) to pass to the code and someway of triggering it after MCEBuddy sorts the files.

---

<div class="post-metadata">

### Author: ![p37307](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/p37307/32/73_2.png) [@p37307](https://discussion.mcebuddy2x.com/u/p37307)
#### Post date: [July 20, 2017, 6:46pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/2 "2017-07-20T18:46:25Z")

</div>

I’m going to run a test using this guide, specifically #4

> [@MCEBuddy - Advanced Settings, Commands and Tweaking](https://discussion.mcebuddy2x.com/t/mcebuddy-advanced-commands-and-tweaking/30):
>
> Advanced concepts to use MCEBuddy Refer to the [MCEBuddy Profiles Basics](https://discussion.mcebuddy2x.com/t/27) page to learn about basic Profiles creation NOTE: Advanced Conversion Parameters apply to profiles.conf Do NOT edit mcebuddy.conf. As of v2.3.13 ALL Advanced Configuration Parameters (except FFmpegBackupRemux) in mcebuddy.conf can be accessed through the GUI, Settings → Expert Settings page DO NOT REPLACE THE NEW CONFIGURATION FILES WITH THE OLD FILES AS PARAMETERS IN THE NEW FILES ARE ADDED/UPDATED WITH EACH RELEASE. …

---

<div class="post-metadata">

### Author: ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)
#### Post date: [July 20, 2017, 7:47pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/3 "2017-07-20T19:47:45Z")

</div>

You can select the option for `Rename without converting` in the Conversion Task -\> Advanced Settings. This will essentially just use MCEBuddy to rename all files using it’s metadata engine (including downloading missing data, turn it off in Expert Settings if you don’t want that) without converting the files.

I think that’s what you’re looking for.

`PostCustomCommand` will still be executed after the renaming is complete.

---

<div class="post-metadata">

### Author: ![p37307](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/p37307/32/73_2.png) [@p37307](https://discussion.mcebuddy2x.com/u/p37307)
#### Post date: [July 22, 2017, 11:32pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/4 "2017-07-22T23:32:06Z")

</div>

Ok, I have the custom command gist of it down.

I’m able to use RBoy’s help to move files into season folders. Thank you!

Now I’m stuck on getting the custom command to write the rename to the NPVR database to prevent NPVR from re-recording and my old recordings show up in NPVR .

I’ve tried it several times and different ways but it fails.The PostCustomCommand errors out and I know it’s because of quotes _ **"** _.

If ran in a CMD window, the command would be, with MCEBuddy’s parameters:

`C:\Program Files (x86)\NPVR\NScriptHelper.exe -Rename %sourcefile% %convertedfile%`

I think the _MCEBuddy_ rules is this:

```
PostCustomCommandPath=C:\Program Files (x86)\NPVR\NScriptHelper.exe
PostCustomCommandParameters=-Rename %convertedfile% %sourcefile%
PostCustomCommandHangPeriod=100
PostCustomCommandCritical=true

```

However, the NPVR command has to be ran in _double quotes_. The command that actually has to be ran is:

`"C:\Program Files (x86)\NPVR\NScriptHelper.exe" -Rename "%sourcefile%" "%convertedfile%"`

I am having trouble separating the command path and parameter and still keeping the entire finished command in _double quotes_.

I read where MCEBuddy has to have _double quotes_ doubled. ““something”” ““Something””.

I’m just lost.

I’m not posting all my attempts of placing double quotes and double double quotes, that would be a long post, but any help will be appreciated.

On a good note, I did a wishlist request just the other day at NextPVR and NextPVR came out with a new release today and implemented the Season folder option. Now I just have to migrate my library over and write the database so nothing gets re-recorded and my recordings are in NPVR which is where the _NScriptHelper.exe -Rename_ comes in.

---

<div class="post-metadata">

### Author: ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)
#### Post date: [July 24, 2017, 7:46pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/5 "2017-07-24T19:46:48Z")

</div>

Try this

```auto
PostCustomCommandPath="C:\Program Files (x86)\NPVR\NScriptHelper.exe"
PostCustomCommandParameters=-Rename "%convertedfile%" "%sourcefile%"
PostCustomCommandHangPeriod=100
PostCustomCommandCritical=true

```

---

<div class="post-metadata">

### Author: ![p37307](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/p37307/32/73_2.png) [@p37307](https://discussion.mcebuddy2x.com/u/p37307)
#### Post date: [July 30, 2017, 8:34pm UTC](https://discussion.mcebuddy2x.com/t/sorting-without-renaming-and-converting/271/6 "2017-07-30T20:34:03Z")

</div>

That worked. I had to shut down NPVR to keep it’s polling process from deleting the show from the recording history while using MCEBuddy to batch move the files to the season folders.

To clairify for future readers of this thread.

NPVR started allowing the option to record tv show episodes and put them in season folders and I wanted to move my previously recorded episodes to season folders and keep them in the NPVR database, which removes episodes when they are no longer where NPVR recorded them.

From the time MCEBuddy move them and then tried to update the NPVR database, NPVR already deleted the episodes from it’s database. Shutting down the NPVR service allowed MCEBuddy to move them and write to the new location to the database. When the NPVR service was restarted the shows was where the database thought they should be.

NPScriptHelper is a commandline program that helps you move recordings and update the database too.

Thanks
