Skip to content

Commit 1916911

Browse files
committed
Fix progress bar counter and removes duplication
1 parent da1bbf4 commit 1916911

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This might be what you are looking for if:
6565

6666
* **You did use WinWazzapMigrator to move from WP to Android**: This is what I did, and what was tested
6767

68-
* **You moved to Android starting from scratch there a while ago, and now you want to bring back all your old WP messages to your current WhatsApp installation.**: This will likely be successful, although it wasn't tested.
68+
* **You moved to Android starting from scratch there a while ago, and now you want to bring back all your old WP messages to your current WhatsApp installation.**: This will likely be successful, although it wasn't tested by me (although [reports claim it works perfectly](https://github.com/ferferga/WhatsAppMigrationTools/issues/1#issuecomment-581165616))
6969

7070
* **You still didn't move from WP and don't want to buy WinWazzapMigrator**: My process is much more difficult and less user-friendly than theirs, but it will likely succeed as well, although it isn't tested. I would say however that this has less chances of being successful than the 2nd case. But worth trying I suppose, you will learn a lot along the way :).
7171

merger/merger.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,8 @@ def optimize_database():
613613
msgcount = msgcount + msgstore.fetchone()[0]
614614
msgstore.execute("SELECT COUNT(message_row_id) FROM message_media")
615615
msgcount = msgcount + msgstore.fetchone()[0] * 2
616+
msgstore.execute("SELECT COUNT(key_id) FROM messages_quotes WHERE key_id NOT IN (SELECT key_id FROM messages)")
617+
msgcount = msgcount + msgstore.fetchone()[0]
616618
print("\nNow backing up data into the temporary database...\n")
617619
# Sometimes, quotes from groups into private chats and deleted messages might be still in messages_quotes while not present in messages, that means that we need
618620
# to take care of them individually, in different loops, instead of doing them all at once in a single loop.
@@ -683,7 +685,7 @@ def optimize_database():
683685
tmp.execute("INSERT INTO keys_relationship VALUES(?,?,?,?,?)", reg2)
684686
except:
685687
pass
686-
msgstore.execute("SELECT key_id, _id FROM messages WHERE key_id NOT IN (SELECT key_id FROM messages)")
688+
msgstore.execute("SELECT key_id, _id FROM messages_quotes WHERE key_id NOT IN (SELECT key_id FROM messages)")
687689
for row in msgstore:
688690
try:
689691
new_quote_id = new_quotes_keys[row[0]]
@@ -1066,15 +1068,6 @@ def optimize_database():
10661068
loopcount = loopcount + 1
10671069
bar.update(loopcount)
10681070
msgstore.execute("SELECT message_row_id FROM message_future")
1069-
for row in msgstore:
1070-
try:
1071-
reg = (keys_relationship[int(row[0])], row[0])
1072-
msgstore2.execute("UPDATE message_future SET message_row_id = ? WHERE message_row_id = ?", reg)
1073-
except:
1074-
pass
1075-
loopcount = loopcount + 1
1076-
bar.update(loopcount)
1077-
msgstore.execute("SELECT message_row_id FROM message_future")
10781071
for row in msgstore:
10791072
try:
10801073
reg = (keys_relationship[int(row[0])], row[0])

0 commit comments

Comments
 (0)