Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • July 24, 2017, 11:51:24 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Folder Sorter by IMDB genre / ratings  (Read 1125 times)

trxtrx

  • Participant
  • Joined in 2016
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Folder Sorter by IMDB genre / ratings
« on: December 10, 2016, 06:38:48 PM »
Hello,

first of all, hello to all of you!

i am here because i am in need of some tools to help me out in my sorting things...

I need to sort several movies folder names by genre.

the name of the folders are like this.

Jeremy.Clarkson.Thriller.DVDRip.XviD-HAGGiS

so, the app should read the folder name, identify the movie name Jeremy Clarkson Thriller and move or create a symbolic link into a Sorted/Genre folder.

Not sure if i was explicit, feel free to ask.

i may need to add other options into the application.

Feel free to email me or pm me. I am willing to pay for this :)

thank you

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 903
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #1 on: July 08, 2017, 04:42:14 AM »
SortMoviesByGenre creates links to movies, placing them in folders of genre, based on parts of their filename. :)

SortMoviesByGenre.jpgFolder Sorter by IMDB genre / ratings

I'm not sure how standardized your foldernames are. I added an option to separate the title and genre from the rest of the folder name by a user defines text, but maybe separating by genre would be better? I could add all the IMDB genres to the file, and use that to split the folder names.

Download and install AutoHotkey to run the script.
Save the script to a text file called SortMoviesByGenre.ahk and double click to run.

Skrommel

Code: Autohotkey [Select]
  1. ;SortMoviesByGenre.ahk
  2. ; Create links to movies, placing them in folders of genre, based on parts of their filename
  3. ;Skrommel @2017
  4.  
  5.  
  6. IniRead,moviefolder,SortMoviesByGenre.ini,Settings,moviefolder
  7. IniRead,sortedfolder,SortMoviesByGenre.ini,Settings,sortedfolder
  8. IniRead,separator,SortMoviesByGenre.ini,Settings,separator
  9. If moviefolder=ERROR
  10.   moviefolder=C:\Movies
  11. If sortedfolder=ERROR
  12.   sortedfolder=C:\Sorted
  13. If separator=ERROR
  14.   separator=.DVD,.CAM,.XVID
  15.  
  16. Gui,Add,Text,xm,Folder with movies
  17. Gui,Add,Edit,xm w300 vmoviefolder,% moviefolder
  18. Gui,Add,Button,x+5 w50 GBROWSEMOVIE,&Browse
  19. Gui,Add,Text,xm,Folder to put links sorted by genre into
  20. Gui,Add,Edit,xm w300 vsortedfolder,% sortedfolder
  21. Gui,Add,Button,x+5 w50 GBROWSESORTED,B&rowse
  22. Gui,Add,Text,xm,Text separating title and genre from the rest of the name.`nUse , between separators
  23. Gui,Add,Edit,xm w300 vseparator,% separator
  24. Gui,Add,Button,xm w50 GSORT +Default,&Sort
  25. Gui,Add,StatusBar,,Skrommel @ 2017
  26. Gui,Show,,SortMoviesByGenre
  27. Return
  28.  
  29.  
  30. BROWSEMOVIE:
  31. {
  32.   FileSelectFolder,newmoviefolder,% "*" moviefolder,3,Select folder with movies
  33.   If ErrorLevel=1
  34.     Return
  35.   IfExist,% newmoviefolder
  36.     Break
  37.   MsgBox,% "The movie folder could not be found!"
  38. }
  39. GuiControl,,moviefolder,% newmoviefolder
  40. Return
  41.  
  42.  
  43. BROWSESORTED:
  44. {
  45.   FileSelectFolder,newsortedfolder,% "*" sortedfolder,3,Select folder with movies
  46.   If ErrorLevel=1
  47.     Return
  48.   IfExist,% newsortedfolder
  49.     Break
  50.   MsgBox,% "The sorted folder could not be found!"
  51. }
  52. GuiControl,,sortedfolder,% newsortedfolder
  53. Return
  54.  
  55.  
  56. Gui,Submit,NoHide
  57. IfNotExist,% moviefolder
  58. {
  59.   MsgBox,% "The movie folder could not be found!"
  60.   Return
  61. }
  62.  
  63. IniWrite,% moviefolder,SortMoviesByGenre.ini,Settings,moviefolder
  64. IniWrite,% sortedfolder,SortMoviesByGenre.ini,Settings,sortedfolder
  65. IniWrite,% separator,SortMoviesByGenre.ini,Settings,separator
  66.  
  67. SB_SetText("Sorting moivies into " sortedfolder "...")
  68. Loop,% moviefolder "\*.*",2,0
  69. {
  70.   first=999                                           ;Extract title and genre
  71.   Loop,Parse,separator,`,
  72.   {
  73.     If (pos>0 And pos<first)
  74.       first:=pos
  75.   }
  76.   StringLeft,titlegenre,A_LoopFileName,% first
  77.  
  78.   StringSplit,part_,titlegenre,`.                     ;Extract genre
  79.   genre:=part_%part_0%
  80.  
  81.   title=                                              ;Extract title
  82.   Loop,% part_0-1
  83.     title:=title part_%A_Index% " "
  84.   title=% title
  85.  
  86.   FileCreateDir,% sortedfolder "\" genre                ;Create link
  87.   FileCreateShortcut,% A_LoopFileLongPath,% sortedfolder "\" genre "\" title ".lnk"
  88. }
  89. SB_SetText("Finished sorting movies into " sortedfolder)
  90. Return
  91.  
  92.  
« Last Edit: July 17, 2017, 05:01:49 PM by skrommel »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 37,225
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #2 on: July 08, 2017, 05:04:12 AM »
Wait.. what just happened?  :huh:

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,589
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #3 on: July 08, 2017, 05:57:26 AM »
Maybe @skrommel responded to the OP through a wormhole in the space-time continuum, or som'at.
It's a funny old world.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 10,719
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #4 on: July 08, 2017, 07:07:44 AM »
 ;D

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 37,225
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #5 on: July 08, 2017, 10:59:34 AM »
This is the moment we've been training all these years for... All DC members who have been certified in level 4 skrommel containment please report to your nearest space-time gate! Suit up and prepare for operation SKROMMEL CAPTURE.
1390.gif

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 8,841
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #6 on: July 08, 2017, 11:48:09 AM »
^ That's cute!

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 7,972
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #7 on: July 08, 2017, 12:48:29 PM »
The legend returns!

Welcome back Skrommel! We hope you'll stick around a while. :Thmbsup:

techidave

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,033
    • View Profile
    • Donate to Member
Re: Folder Sorter by IMDB genre / ratings
« Reply #8 on: July 09, 2017, 07:07:10 AM »
its back Skrommel!