# gpsEdit Version 1.01

import glob
import os.path
import shutil

media_dir = "//sr3//home//Temp//"
media_list = []
vanilla_media_list = []

file_move_cnt = 0


def build_media():
    global media_list
    media_list = glob.glob(media_dir + "*", recursive=False)


def build_vanilla_media():
    global vanilla_media_list, media_list
    for x in media_list:
        c_file = str(x).replace("-edited", "")
        if os.path.isfile(c_file) and x != c_file:
            if not vanilla_media_list.__contains__(c_file):
                vanilla_media_list.append(c_file)



def move_vanilla_media():
    global media_dir, vanilla_media_list, file_move_cnt
    dest_dir = media_dir + "_VanillaMedia\\"

    if not os.path.exists(dest_dir):
        os.mkdir(dest_dir)

    for x in vanilla_media_list:
        shutil.move(x, dest_dir)
        file_move_cnt += 1
        print("Moving " + str(x))


if __name__ == "__main__":
    build_media()
    build_vanilla_media()
    move_vanilla_media()
    print("Finished moving " + str(file_move_cnt) + " file(s).")
