diff --git a/README.md b/README.md index 2aa5e43..fe8a46c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Anicon for AniList -# Work In Progress + Add cover art from Anilist as folder icons to your anime collection. ### How do I use this? -- Download the executable from [here](https:) +- Download the executable from [here](https://github.com/EnArvy/AniconforAnilist/releases) - Run it in your anime folder - Choose when you're asked to - Repeat till all folders are processed @@ -22,6 +22,7 @@ If you're not using AutoMode, you can give a blank input when you're asked to ch ### Okay so i did everything, but the icons aren't showing up. (*panicks*) Your PC may take some time to index those icons. They should show up in 2 to 5 minutes. I guess. +Note:Usually making chnages to files inside the folder makes icon appear(such as creating a new txt file or something). ### Alright. It works but I'm curious as to how? It, uhhh @@ -40,3 +41,8 @@ Yeah, the most efficient way to use this (imo) would be to: - Move out the incorrectly tagged folders and delete their icons - Run it in ManualMode and choose the correct results +## Building from source +Requirements: python installed along with pillow(use `pip install pillow`) and pyinstaller(use `pip install pyinstaller`) + +Then in the directory run `pyinstaller aniconforanilist.py --onefile` + diff --git a/Screenshot 2021-03-22 000522.png~ b/Screenshot 2021-03-22 000522.png~ deleted file mode 100644 index 0ad1847..0000000 Binary files a/Screenshot 2021-03-22 000522.png~ and /dev/null differ diff --git a/aniconforanilist.py b/aniconforanilist.py index 8922a5b..2fdb8c0 100644 --- a/aniconforanilist.py +++ b/aniconforanilist.py @@ -14,7 +14,7 @@ filterwarnings("ignore") folderlist = next(os.walk('.'))[1] -folderpath = os.path.dirname(os.path.realpath(__file__)) + if folderlist is None or len(folderlist) == 0: # In case the file is placed inside an inner most directory which contains only files and no other folders, this list will be empty. # Thus adding the current directory path as an element of the list. @@ -128,9 +128,9 @@ def createicon(folder: str, link: str): f = open(folder + "\\desktop.ini","w+") - icopath = folderpath + '\\' + icofile + f.write("[.ShellClassInfo]\nConfirmFileOp=0\n") - f.write("IconResource={},0".format(icopath.strip("\\"))) + f.write("IconResource={},0".format(icofile.replace(folder, "").strip("\\"))) f.write("\nIconFile={}\nIconIndex=0".format(icofile.replace(folder, "").strip("\\"))) f.write("\n[ViewState]\nMode=\nVid=\nFolderType=Videos")