INTERACT FORUM

Please login or register.

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

Author Topic: Replace/Rename existing Movie file without re-import  (Read 1032 times)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Replace/Rename existing Movie file without re-import
« on: December 16, 2019, 12:45:43 pm »

Hi,
I can't find a good way of replacing an existing file in MC with a newer version/rip, without having to Import the new one and delete the old one. Doing this loses all existing tags, playlist association, dates, etc, that the previous file had.

For example, I have this in my collection:
A Simple Plan (1998)(720p).avi
I now want to replace it with a newer version, which is now an MKV, and I'm now using a different naming structure:
A.Simple.Plan.1998.1080p.h265.mkv

If I just import the new file and remove the old one, I lose most metadata that I care about and, most annoying, the new file won't belong to the playlists that the old one did. It also changes the "Date Imported", which is also annoying because I have most of my playlists sorted by that field - this causes the title to move to top.

What I would like it to do:
  • replace the PATH of an existing title to the new file (folder structure may also change)
  • re-read the media-specific fields which are now changed: bitrate, codec, resolution, etc
  • keep everything else: file must still belong to same playlists (smartlists based on changed fields might of course change), other tags must remain the same, including import/view dates, etc.
I've tried LibraryTools->Rename, but it doesn't do this, and gets thrown off by the changed file extension.
Is there any way to accomplish this?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Replace/Rename existing Movie file without re-import
« Reply #1 on: December 16, 2019, 01:03:07 pm »

I've done a good bit of this with Music and a little bit with movies.  You need to do kind of an odd sequence to make it work correctly.  Here's an outline of the process:


1.  Rename your existing file (the one you want to get rid of) using the RM&C command in MC.  Make the new filename something REALLY simple like "a.avi".  In your case, since you are changing formats too, let's go ahead and rename it to "a.mkv".  Again, use the RM&C tool to do this.  You will probably need to use the Find and Replace template in order to change the extension to mkv.

2.  Name your new file (the one you want to keep) the exact same name.  So rename your new MKV file to a.mkv .  Use Windows Explorer or another file based tool to do this.

3.  Copy the new file over the top of the old file, replacing it.  Also use Windows Explorer or another file based tool to do this.

4.  Now MC should see your new file with the really short name (a.mkv), but it doesn't know it's got new stuff in it yet.  So, update MC so it sees the new stuff.
<right click on file in MC> Library Tools > Update Library (from tags)
This will force MC to re-read the file, and bring in it's new format, duration, etc.

5.  Rename the file, using RM&C back to a name that makes sense.  I generally use the [Name] and [Year] fields, as this is enough info for me in the filename.  However, I see that your names have more detail in them.  If you want to keep that detailed name, then you will need to either manually re-type it (in RM&C) or copy that filename to somewhere else before you start and then cut and paste it into RM&C.

Other than step 5, this is actually a lot faster and easier than it sounds.  But it is detailed and you have to keep track of what you are doing.

Good luck,

Brian.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2036
Re: Replace/Rename existing Movie file without re-import
« Reply #2 on: December 16, 2019, 03:30:28 pm »

I would just change tag [File Type] from avi to mkv and run RM&C (F6) with your rename script(*) and then use that filename also for your new file (copy paste in explorer) and replace old "avi" (now also named as xxx.mkv even though it isn't) with new real mkv file.

The do "update library (from tags)" in MC for the file to refresh its file properties (NOTE: this will erase your rating)

* if you haven't configured RM&C for your liking maybe it's better uncheck everything but filename and use harcoded "A.Simple.Plan.1998.1080p.h265" value there


Quote
replace the PATH of an existing title to the new file (folder structure may also change)
oh, this complicates things a bit. For that you should really configure your folder and naming schema to RM&C tool and use its "update database to point to new location" option to change database to the new file. after that you can remove old file
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Replace/Rename existing Movie file without re-import
« Reply #3 on: December 21, 2019, 03:59:43 am »

Thank you for your answers. After fiddling a bit, I came up with this method which is a variation of the above suggestions. This works for changing filename, path and filetype, while keeping the previous ImportedDate and existing Playlist memberships, as I wanted. File properties such as resolution, bitrate, codec, etc are also updated.

Let's say you want to replace MovieA\MovieA.avi with MovieB\MovieB.mkv:
  • Disable "Run Auto-import in Background" so that filesystem changes don't get imported immediately
  • Don't copy MovieB yet to the media folder (MovieB folder must not exist yet)
  • Export MovieA tags with LibraryTools->"Update Tags (from Library)"
  • In JR, set MovieA field "Filename" to the new full path = "MovieB\MovieB.mkv" (JR will rename MovieA to MovieB, including folder and extension)
  • Using Windows Explorer, overwrite the renamed MovieB folder/files with the new/actual MovieB files. Make sure to keep the sidecar.xml!
  • In JR, update tags and media properties with LibraryTools->"Update Library (from tags)"

That's it! Not too complicated, but a bit annoying process when doing many files. Still, it works :)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Replace/Rename existing Movie file without re-import
« Reply #4 on: January 12, 2020, 11:22:36 am »

Meanwhile I added a way to do this via my tool, MCRatings :)
https://github.com/zybexXL/MCRatings

v2 now allows editing the DateImported, or copying it from another movie. It also copies Playlists from one movie to another.
Logged
Pages: [1]   Go Up