-
Notifications
You must be signed in to change notification settings - Fork 0
/
duplicateTest.py
43 lines (31 loc) · 1.09 KB
/
duplicateTest.py
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
import os
currentPath = os.getcwd()
MANGA_DIR = os.path.join(currentPath, 'manga')
#################### RUN THIS FILE TO CHECK IF YOUR MANGA IDS ARE CORRECTLY MANAGED ############################
#################### THIS IS ONLY NEEDED IF YOU HAVE DELETED MANGA FROM YOUR "MANGA" DIRECTORY #################
def getAllIds():
allDirs = os.listdir(MANGA_DIR)
allIds = []
for dir in allDirs:
print(dir, end=' ')
idFile = os.path.join(MANGA_DIR, dir, 'id.txt')
with open(idFile, 'r') as fid:
mangaId = fid.read()
allIds.append(int(mangaId))
print("id:", mangaId)
fid.close()
print(allIds)
return allIds
allid = getAllIds()
allid.sort()
highestValue = allid[len(allid)-1]
for num in range(len(allid)):
if num <= 0:
continue
if allid[num]!= num + 1:
print(f"There are a total of {len(allid)} manga, although the highest value is {highestValue}")
print(allid)
input(f"Missing manga with ID: {num} or {num+1}")
quit()
print(len(allid))
input("No Invalid ID's found")