#1 2017-06-20 11:29

Dirk
Member
Registered: 2013-04-05
Posts: 91

Folders renamed with the name of the movie containing?

I would like to have folders with undefined names renamed with the name (without extension) of the movie (mkv, avi, mp4, etc.) each of those folders contain.

Each folder (second level of the root folder) is a sub folder of the folder "Movies" (root) somewhere on the drive.
  Each folder (second level) generally contains a single movie and (or can contain) an undefined amount of files with undefined extensions.
  If possible at all: If such a folder (second level) contains more movies in the same folder than one movie it shall not be renamed - besides of the other movie(s) is / are in any sub folder (third level and lower) of that folder (second level)

All of those files / sub folders in the folders (second level) shall be kept like the are, unchanged. Only the folder (second level) shall be renamed

Example:

F:\Movies\Aladin.UNCUT - unnamed Folder\.actors
F:\Movies\Aladin.UNCUT - unnamed Folder\extrafanart
F:\Movies\Aladin.UNCUT - unnamed Folder\extrathumbs
F:\Movies\Aladin.UNCUT - unnamed Folder\[b]Aladin (1986).mkv[/b]
F:\Movies\Aladin.UNCUT - unnamed Folder\fanart.jpg
F:\Movies\Aladin.UNCUT - unnamed Folder\movie.nfo
F:\Movies\Aladin.UNCUT - unnamed Folder\poster.jpg

Output (the same outputs like they are in this thread: http://www.den4b.com/forum/viewtopic.php?id=2321):

F:\Movies\Aladin (1986)\.actors
F:\Movies\Aladin (1986)\extrafanart
F:\Movies\Aladin (1986)\extrathumbs
F:\Movies\Aladin (1986)\Aladin (1986).mkv
F:\Movies\Aladin (1986)\fanart.jpg
F:\Movies\Aladin (1986)\movie.nfo
F:\Movies\Aladin (1986)\poster.jpg
Extended example:

[dm]	[attr]	[s_bytes]	[ne]
        I:\Eigene Dateien\Videos\Movies\Godzi - extended - 02,00021,3.000 THB
2017-04-24 09-29-36	A-------	157.755 	banner.jpg
2017-04-24 09-29-36	A-------	498.595 	clearart.png
2017-04-24 09-29-35	A-------	81.237 	clearlogo.png
2017-04-24 09-29-39	A-------	1.133.362 	disc.png
2017-04-24 09-29-35	A-------	157.509 	fanart.jpg
2017-04-03 11-55-14	A-------	2.672.973.416 	Godzi - extended - 02,00021,3.000 THB.mkv
2017-04-24 09-29-35	A-------	81.237 	logo.png
2017-04-24 09-16-43	A-------	26.147 	movie.nfo
2017-04-24 09-29-34	A-------	69.843 	poster.jpg
2017-04-24 09-29-37	A-------	303.485 	thumb.jpg
----------------------------------------------------------------------------------------------------
Folder: "Godzi - extended - 02,00021,3.000 THB"          Number of files: 10          Size of files: 2.675.482.586 

        I:\Eigene Dateien\Videos\Movies\Godzi - extended - 02,00021,3.000 THB\.actors
2017-04-04 00-55-08	A-------	18.578 	Ali_Afshar.jpg
2017-01-18 13-33-23	A-------	52.263 	Al_Goto.jpg
2017-04-04 00-55-16	A-------	22.899 	Al_Leong.jpg
2017-03-07 20-08-12	A-------	17.583 	Al_Sapienza.jpg
2017-04-04 00-55-14	A-------	27.863 	Benjamin_Baird.jpg
2017-04-04 00-55-15	A-------	31.660 	Ben_Bode.jpg
2017-04-04 00-55-14	A-------	13.015 	Bill_Hoag.jpg
2017-04-04 00-55-05	A-------	31.547 	Bodhi_Elfman.jpg
2017-04-04 00-55-09	A-------	28.533 	Burt_Bulos.jpg
2017-04-02 01-25-49	A-------	26.094 	Chris_Ellis.jpg
2017-02-22 11-54-03	A-------	27.678 	Clyde_Kusatsu.jpg
2017-04-04 00-55-13	A-------	21.396 	Craig_Castaldo.jpg
2017-04-04 00-55-07	A-------	26.310 	David_Pressman.jpg
2016-12-31 11-22-51	A-------	29.474 	Derek_Webster.jpg
2017-04-04 00-55-04	A-------	19.945 	Doug_Savant.jpg
2017-04-04 00-55-14	A-------	20.818 	Ed_Wheeler.jpg
2017-04-04 00-55-04	A-------	38.917 	Frank_Bruynbroek.jpg
2017-01-16 14-49-50	A-------	31.346 	Frank_Welker.jpg
2017-04-04 00-55-17	A-------	34.629 	Fred_Sanders.jpg
2017-04-04 00-55-15	A-------	45.830 	George_Cheung.jpg
2017-03-16 16-08-20	A-------	15.493 	Glenn_Morshower.jpg
2017-04-04 00-55-11	A-------	20.147 	Greg_Collins.jpg
2017-04-04 00-55-16	A-------	20.231 	Gretchen_Mol.jpg
2017-04-04 00-55-03	A-------	18.377 	Hank_Azaria.jpg
2016-12-14 03-09-37	A-------	23.857 	Harry_Shearer.jpg
2017-04-04 00-55-12	A-------	34.991 	James_Black.jpg
2017-04-04 00-55-10	A-------	29.984 	Jamison_Yang.jpg
2017-01-16 14-49-38	A-------	18.614 	Jean_Reno.jpg
2017-04-04 00-55-16	A-------	24.223 	John_Koyama.jpg
2017-03-31 20-12-19	A-------	30.332 	John_Wilkie.jpg
2017-04-04 00-55-16	A-------	25.134 	Judy_Reyes.jpg
2017-03-13 11-09-25	A-------	28.766 	Ken_Lerner.jpg
2017-04-04 00-55-03	A-------	24.296 	Kevin_Dunn.jpg
2017-04-04 00-55-08	A-------	36.595 	Kirk_Geiger.jpg
2017-04-04 00-55-15	A-------	32.849 	Kurt_Carley.jpg
2017-04-04 00-55-16	A-------	15.765 	Lance_Reddick.jpg
2017-04-04 00-55-11	A-------	15.968 	Lawton_Paseka.jpg
2017-04-04 00-55-14	A-------	51.880 	Lee_Weaver.jpg
2017-04-04 00-55-17	A-------	38.365 	Leif_Riddell.jpg
2017-04-04 00-55-06	A-------	41.275 	Lola_Pashalinski.jpg
2017-04-04 00-55-04	A-------	13.985 	Malcolm_Danare.jpg
2017-04-04 00-55-03	A-------	41.046 	Maria_Pitillo.jpg
2017-04-04 00-55-13	A-------	31.253 	Mark_Fite.jpg
2017-04-04 00-55-15	A-------	34.133 	Mary_Ann_Giannino.jpg
2016-12-31 16-03-54	A-------	20.995 	Matthew_Broderick.jpg
2017-03-14 12-52-43	A-------	51.161 	Michael_Lerner.jpg
2017-04-04 00-55-17	A-------	8.748 	Michael_Tota.jpg
2017-04-04 00-55-13	A-------	39.291 	Montae_Russell.jpg
2017-04-04 00-55-04	A-------	50.796 	Nancy_Cartwright.jpg
2017-04-04 00-55-10	A-------	11.758 	Nathan_Anderson.jpg
2017-04-04 00-55-04	A-------	19.544 	Nicholas_J._Giangiulio.jpg
2017-04-04 00-55-08	A-------	17.065 	Pat_Mastroianni.jpg
2017-03-16 15-19-31	A-------	35.070 	Philippe_Bergeron.jpg
2017-04-23 22-04-07	A-------	21.900 	Ralph_Manza.jpg
2017-04-04 00-55-05	A-------	23.981 	Richard_Gant.jpg
2017-04-04 00-55-06	A-------	49.666 	Rich_Grosso.jpg
2017-04-04 00-55-10	A-------	16.693 	Robert_Floyd.jpg
2017-04-04 00-55-07	A-------	26.428 	Roger_McIntyre.jpg
2017-04-04 00-55-10	A-------	15.490 	Seth_Peterson.jpg
2017-04-04 00-55-15	A-------	22.640 	Steven_Ho.jpg
2016-12-14 16-08-42	A-------	13.613 	Stoney_Westmoreland.jpg
2017-04-04 00-55-07	A-------	11.637 	Stuart_Fratkin.jpg
2017-04-04 00-55-17	A-------	5.271 	Tadao_Tomomatsu.jpg
2017-04-04 00-55-06	A-------	8.252 	Toshi_Toda.jpg
2017-04-04 00-55-03	A-------	22.710 	Vicki_Lewis.jpg
----------------------------------------------------------------------------------------------------
Folder: ".actors"          Number of files: 65          Size of files: 1.726.646 

        I:\Eigene Dateien\Videos\Movies\Godzi - extended - 02,00021,3.000 THB\extrafanart
2017-04-24 09-29-37	A-------	157.509 	fanart1.jpg
2017-04-24 09-29-38	A-------	187.993 	fanart2.jpg
2017-04-24 09-29-39	A-------	217.597 	fanart3.jpg
2017-04-24 09-29-40	A-------	141.837 	fanart4.jpg
2017-04-24 09-29-40	A-------	100.317 	fanart5.jpg
2017-04-24 09-29-41	A-------	130.532 	fanart6.jpg
2017-04-24 09-29-41	A-------	206.394 	fanart7.jpg
----------------------------------------------------------------------------------------------------
Folder: "extrafanart"          Number of files: 7          Size of files: 1.142.179 

        I:\Eigene Dateien\Videos\Movies\Godzi - extended - 02,00021,3.000 THB\extrathumbs
2017-04-24 09-29-37	A-------	157.509 	thumb1.jpg
2017-04-24 09-29-38	A-------	187.993 	thumb2.jpg
2017-04-24 09-29-39	A-------	217.597 	thumb3.jpg
2017-04-24 09-29-39	A-------	141.837 	thumb4.jpg
2017-04-24 09-29-39	A-------	100.317 	thumb5.jpg
2017-04-24 09-29-40	A-------	130.532 	thumb6.jpg
2017-04-24 09-29-40	A-------	206.394 	thumb7.jpg
----------------------------------------------------------------------------------------------------
Folder: "extrathumbs"          Number of files: 7          Size of files: 1.142.179 

----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Summary - Folders: 4          Files: 89          Size of files: 2.679.493.590  Byte(s)




Output:




[dm]	[attr]	[s_bytes]	[ne]
        I:\Eigene Dateien\Videos\Movies\Godzilla (1998)
2017-04-24 09-29-36	A-------	157.755 	banner.jpg
2017-04-24 09-29-36	A-------	498.595 	clearart.png
2017-04-24 09-29-35	A-------	81.237 	clearlogo.png
2017-04-24 09-29-39	A-------	1.133.362 	disc.png
2017-04-24 09-29-35	A-------	157.509 	fanart.jpg
2017-04-03 11-55-14	A-------	2.672.973.416 	Godzilla (1998).mkv
2017-04-24 09-29-35	A-------	81.237 	logo.png
2017-04-24 09-16-43	A-------	26.147 	movie.nfo
2017-04-24 09-29-34	A-------	69.843 	poster.jpg
2017-04-24 09-29-37	A-------	303.485 	thumb.jpg
----------------------------------------------------------------------------------------------------
Folder: "Godzilla (1998)"          Number of files: 10          Size of files: 2.675.482.586 

        I:\Eigene Dateien\Videos\Movies\Godzilla (1998)\.actors
2017-04-04 00-55-08	A-------	18.578 	Ali_Afshar.jpg
2017-01-18 13-33-23	A-------	52.263 	Al_Goto.jpg
2017-04-04 00-55-16	A-------	22.899 	Al_Leong.jpg
2017-03-07 20-08-12	A-------	17.583 	Al_Sapienza.jpg
2017-04-04 00-55-14	A-------	27.863 	Benjamin_Baird.jpg
2017-04-04 00-55-15	A-------	31.660 	Ben_Bode.jpg
2017-04-04 00-55-14	A-------	13.015 	Bill_Hoag.jpg
2017-04-04 00-55-05	A-------	31.547 	Bodhi_Elfman.jpg
2017-04-04 00-55-09	A-------	28.533 	Burt_Bulos.jpg
2017-04-02 01-25-49	A-------	26.094 	Chris_Ellis.jpg
2017-02-22 11-54-03	A-------	27.678 	Clyde_Kusatsu.jpg
2017-04-04 00-55-13	A-------	21.396 	Craig_Castaldo.jpg
2017-04-04 00-55-07	A-------	26.310 	David_Pressman.jpg
2016-12-31 11-22-51	A-------	29.474 	Derek_Webster.jpg
2017-04-04 00-55-04	A-------	19.945 	Doug_Savant.jpg
2017-04-04 00-55-14	A-------	20.818 	Ed_Wheeler.jpg
2017-04-04 00-55-04	A-------	38.917 	Frank_Bruynbroek.jpg
2017-01-16 14-49-50	A-------	31.346 	Frank_Welker.jpg
2017-04-04 00-55-17	A-------	34.629 	Fred_Sanders.jpg
2017-04-04 00-55-15	A-------	45.830 	George_Cheung.jpg
2017-03-16 16-08-20	A-------	15.493 	Glenn_Morshower.jpg
2017-04-04 00-55-11	A-------	20.147 	Greg_Collins.jpg
2017-04-04 00-55-16	A-------	20.231 	Gretchen_Mol.jpg
2017-04-04 00-55-03	A-------	18.377 	Hank_Azaria.jpg
2016-12-14 03-09-37	A-------	23.857 	Harry_Shearer.jpg
2017-04-04 00-55-12	A-------	34.991 	James_Black.jpg
2017-04-04 00-55-10	A-------	29.984 	Jamison_Yang.jpg
2017-01-16 14-49-38	A-------	18.614 	Jean_Reno.jpg
2017-04-04 00-55-16	A-------	24.223 	John_Koyama.jpg
2017-03-31 20-12-19	A-------	30.332 	John_Wilkie.jpg
2017-04-04 00-55-16	A-------	25.134 	Judy_Reyes.jpg
2017-03-13 11-09-25	A-------	28.766 	Ken_Lerner.jpg
2017-04-04 00-55-03	A-------	24.296 	Kevin_Dunn.jpg
2017-04-04 00-55-08	A-------	36.595 	Kirk_Geiger.jpg
2017-04-04 00-55-15	A-------	32.849 	Kurt_Carley.jpg
2017-04-04 00-55-16	A-------	15.765 	Lance_Reddick.jpg
2017-04-04 00-55-11	A-------	15.968 	Lawton_Paseka.jpg
2017-04-04 00-55-14	A-------	51.880 	Lee_Weaver.jpg
2017-04-04 00-55-17	A-------	38.365 	Leif_Riddell.jpg
2017-04-04 00-55-06	A-------	41.275 	Lola_Pashalinski.jpg
2017-04-04 00-55-04	A-------	13.985 	Malcolm_Danare.jpg
2017-04-04 00-55-03	A-------	41.046 	Maria_Pitillo.jpg
2017-04-04 00-55-13	A-------	31.253 	Mark_Fite.jpg
2017-04-04 00-55-15	A-------	34.133 	Mary_Ann_Giannino.jpg
2016-12-31 16-03-54	A-------	20.995 	Matthew_Broderick.jpg
2017-03-14 12-52-43	A-------	51.161 	Michael_Lerner.jpg
2017-04-04 00-55-17	A-------	8.748 	Michael_Tota.jpg
2017-04-04 00-55-13	A-------	39.291 	Montae_Russell.jpg
2017-04-04 00-55-04	A-------	50.796 	Nancy_Cartwright.jpg
2017-04-04 00-55-10	A-------	11.758 	Nathan_Anderson.jpg
2017-04-04 00-55-04	A-------	19.544 	Nicholas_J._Giangiulio.jpg
2017-04-04 00-55-08	A-------	17.065 	Pat_Mastroianni.jpg
2017-03-16 15-19-31	A-------	35.070 	Philippe_Bergeron.jpg
2017-04-23 22-04-07	A-------	21.900 	Ralph_Manza.jpg
2017-04-04 00-55-05	A-------	23.981 	Richard_Gant.jpg
2017-04-04 00-55-06	A-------	49.666 	Rich_Grosso.jpg
2017-04-04 00-55-10	A-------	16.693 	Robert_Floyd.jpg
2017-04-04 00-55-07	A-------	26.428 	Roger_McIntyre.jpg
2017-04-04 00-55-10	A-------	15.490 	Seth_Peterson.jpg
2017-04-04 00-55-15	A-------	22.640 	Steven_Ho.jpg
2016-12-14 16-08-42	A-------	13.613 	Stoney_Westmoreland.jpg
2017-04-04 00-55-07	A-------	11.637 	Stuart_Fratkin.jpg
2017-04-04 00-55-17	A-------	5.271 	Tadao_Tomomatsu.jpg
2017-04-04 00-55-06	A-------	8.252 	Toshi_Toda.jpg
2017-04-04 00-55-03	A-------	22.710 	Vicki_Lewis.jpg
----------------------------------------------------------------------------------------------------
Folder: ".actors"          Number of files: 65          Size of files: 1.726.646 

        I:\Eigene Dateien\Videos\Movies\Godzilla (1998)\extrafanart
2017-04-24 09-29-37	A-------	157.509 	fanart1.jpg
2017-04-24 09-29-38	A-------	187.993 	fanart2.jpg
2017-04-24 09-29-39	A-------	217.597 	fanart3.jpg
2017-04-24 09-29-40	A-------	141.837 	fanart4.jpg
2017-04-24 09-29-40	A-------	100.317 	fanart5.jpg
2017-04-24 09-29-41	A-------	130.532 	fanart6.jpg
2017-04-24 09-29-41	A-------	206.394 	fanart7.jpg
----------------------------------------------------------------------------------------------------
Folder: "extrafanart"          Number of files: 7          Size of files: 1.142.179 

        I:\Eigene Dateien\Videos\Movies\Godzilla (1998)\extrathumbs
2017-04-24 09-29-37	A-------	157.509 	thumb1.jpg
2017-04-24 09-29-38	A-------	187.993 	thumb2.jpg
2017-04-24 09-29-39	A-------	217.597 	thumb3.jpg
2017-04-24 09-29-39	A-------	141.837 	thumb4.jpg
2017-04-24 09-29-39	A-------	100.317 	thumb5.jpg
2017-04-24 09-29-40	A-------	130.532 	thumb6.jpg
2017-04-24 09-29-40	A-------	206.394 	thumb7.jpg
----------------------------------------------------------------------------------------------------
Folder: "extrathumbs"          Number of files: 7          Size of files: 1.142.179 

----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Summary - Folders: 4          Files: 89          Size of files: 2.679.493.590  Byte(s)

Or, the same output of the last example above:
FkttCPm.png

Offline

#2 2017-06-20 11:59

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Folders renamed with the name of the movie containing?

The following script will scan a directory, find the first file with a matching extension ("mkv", "avi", "mp4") and use its name as the new name for the scanned directory.

You just need to adjust your Filter Settings in ReNamer to add your movie folders for renaming and use the script below.

var
  Files: TWideStringArray;
  FileExt: WideString;
  IsMovieFile: Boolean;
  I: Integer;

begin
  if WideDirectoryExists(FilePath) then
  begin
    SetLength(Files, 0);
    WideScanDirForFiles(FilePath, Files, False, False, False, '');
    for I := 0 to Length(Files) - 1 do
    begin
      FileExt := WideLowerCase(WideExtractFileExt(Files[I]));
      IsMovieFile :=
        (FileExt = '.mkv') or
        (FileExt = '.avi') or
        (FileExt = '.mp4');
      if IsMovieFile then
      begin
        FileName := WideExtractBaseName(Files[I]);
        Break;
      end;
    end;
  end;
end.

Offline

#3 2017-06-20 13:07

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Folders renamed with the name of the movie containing?

That was extremely fast done! Thank you very much!

Works perfectly:
nogg137.png

I have dragged the folders (second level), not the root folder "Movies", into the GUI and used these "Filter Settings":
Bg4EpOv.png

This message appears when there might be conflicts:
f487JYV.png

And those conflicts can be avoid when the folder sorting is changed to this:
WC9jyF3.png

So that menas the conflicts are gone now, if I see it right. But after clicking "Rename" that message appears again, although there are no such conflicts anymore, if I understand it right. Actually I would think - like I did the first times, irritated a little bit - there are still the same and / or other conflicts because the message still appears, but it really isn't like that, I think, I hope at least.

Very many thanks again.

Offline

#4 2017-06-21 09:14

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Folders renamed with the name of the movie containing?

That warning is displayed for informational purposes when renaming folders, whether you had or didn't have conflicts. In you case, you didn't actually have any conflicts, but the warning is displayed nonetheless. If you don't want to see this warning again, just tick the box "Never show this warning".

If you had attempted to rename both the folders and their contained files/subfolders at the same time, then this warning would be of greater importance and so is the sorting order.

You might also find this wiki article of use:
ReNamer:Renaming_folders

Offline

#5 2017-06-21 09:32

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Folders renamed with the name of the movie containing?

That warning is displayed for informational purposes when renaming folders, whether you had or didn't have conflicts. In you case, you didn't actually have any conflicts, but the warning is displayed nonetheless. If you don't want to see this warning again, just tick the box "Never show this warning".

No, no, it is an importend warning, I assume, wouldn't want to miss it (when there are conflicts). I just was wondering why it is shown if there are not any conflicts. This warning shown although there are not any conflicts just irritates me. So actually I - having any idea of anything - would think, when there are not any conflicts (anymore) it should not be shown.

Thank you for the link. So to rename with the lessest risk it might be the best (for people like me) to not to rename in a single run but first rename the files, after the folders. It would be not cause that much more complexity.

Offline

#6 2017-06-23 10:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Folders renamed with the name of the movie containing?

Dirk wrote:

I just was wondering why it is shown if there are not any conflicts. This warning shown although there are not any conflicts just irritates me. So actually I - having any idea of anything - would think, when there are not any conflicts (anymore) it should not be shown.

Recent versions of ReNamer (since v6.4.0.3 Beta) can pick up these conflicts through the validation process, which is performed after every preview by default. Conflicting items will be marked by a validation warning "Parent path changed earlier in the list".

The warning dialog that you see just before renaming is shown for a legacy purpose. At this stage its purpose is to explain why such conflicts exist and to suggest how to deal with them.

You are right, the warning before renaming should not be shown if there are no conflicts detected. This will be addressed in future versions.

Offline

#7 2017-06-23 10:41

Dirk
Member
Registered: 2013-04-05
Posts: 91

Re: Folders renamed with the name of the movie containing?

Alright, I understand, thank you.

That is good, no warnings wthout conflicts in the next versions.

Many thanks again

Offline

Board footer

Powered by FluxBB