-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMediaMover.au3
80 lines (71 loc) · 1.81 KB
/
MediaMover.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#cs ----------------------------------------------------------------------------
Author: biodrone
Script Function:
Takes media put into a folder and sorts it into another place [media drive]
so that it can be scanned properly by media streamers
#ce ----------------------------------------------------------------------------
;include timez
#include <File.au3>
#include <Array.au3>
Main()
Func Main()
;tell it where to find the media
Global $src = "E:\Documents\Dropbox\MediaTemp\"
Global $dst = "I:\TV\"
;do all the file goodness
;For TV Shows
Populate($src)
;For other files
;This needs to be done...
EndFunc
Func Populate($src)
Local $fileList = _FileListToArray($src)
Local $i = 0
;gets the info for the individual files
If @error Then
Exit
Else
For $element in $fileList
If IsInt($element) = 1 Then
Else
Local $filename = StringSplit($element, ".")
Local $show = $filename[1] ;extract the show title
Local $season = StringLeft($filename[2], 3) ;extract the season
move($show, seasonCalc($season), $element) ;move the file
EndIf
Next
EndIf
EndFunc
Func seasonCalc($s)
Select
Case $s = "S01"
Return "Season 1"
Case $s = "S02"
Return "Season 2"
Case $s = "S03"
Return "Season 3"
Case $s = "S04"
Return "Season 4"
Case $s = "S05"
Return "Season 5"
Case $s = "S06"
Return "Season 6"
Case $s = "S07"
Return "Season 7"
Case $s = "S08"
Return "Season 8"
Case $s = "S09"
Return "Season 9"
Case $s = "S10"
Return "Season 10"
Case $s = "S11"
Return "Season 11"
EndSelect
EndFunc
Func move($show, $season, $name)
Local $fShow = $show & "\"
Local $fSeason = $season & "\"
Local $source = $dropbox & $name
Local $dest = $media & $fShow & $fSeason & $name
FileMove($source, $dest)
EndFunc