Categories
website

Week3 – Rewrite and Design

The amount of information and work this week has increased compared to the previous two weeks.

At the end of last week, I completed rewriting the original web code in Python. What remains are the new features that still need to be implemented. I asked Sev about the upcoming tasks and understood the entire workflow.

I have summarized the four workflows as follows:

I also successfully deployed the test webpage, which was previously only deployed locally, to the server. Additionally, the data population used data generated from the actual scummvm.dat instead of data I fabricated myself.

I fixed dat_parser, and now it can properly parse strings and insert data into the server.

It seems like a lot of features have indeed been implemented, but there are still some bugs that haven’t been fixed yet (duplicate file detection, database operations being too slow, etc.).

Besides, here is Sev’s suggestion for implementations

” Since we do have entries that have equal set of files with the only difference is the language and/or platform, then add those to the megakey, so, in case there is a change in those fields, it will be treated as a newly created fileset and in order to manage it, implement a way for manual merge of filesets, which will lead to metada of an old version be overridden by the metadata from the incoming one, pertaining history”

I will focus on these issues next week.

Categories
website

Week2 – Getting better

This week, my main tasks were parsing the .dat files and fixing errors in the original database functions. After closely examining some .dat files, I found their format very similar to JSON, which I am quite familiar with. Thus, I only needed to perform some bracket-matching operations.

However, when I tried to port the PHP code to Python, I encountered numerous errors. The issues were due to Python’s need for additional boundary checks on strings and differences in database operations between Pymysql and PHP. Additionally, the original code contains some unnecessary transaction operations. It should only require cursor.execute() instead of using conn.commit() . After making the necessary fixes, I successfully resolved these issues.

 

Currently, I have replicated most of the main functionalities of the original code. Only a few minor details related to appearance and database exception handling remain, which I plan to address next week.

Categories
website

Week1 – Start

In the first week, my main task was to replace the original PHP server code with Python code. My plan was to use the Flask library to create a web server.

During the first week, I primarily focused on rewriting all the functions in the original db_functions.php file. This mainly involved operations related to MySQL and SQL statements, so I used the pymysql library to complete the rewrite. The commit record is here: https://github.com/InariInDream/scummvm-sites/commits/integrity/

 

However, the appearance displayed on the web page cannot be generated as simply as in PHP using statements like echo "<h2><u>Fileset: {$id}</u></h2>";. It needs to be rendered through Flask. Therefore, my focus for the next week will be on the design of the appearance (tables, forms).

As of now, I haven’t encountered any significant technical difficulties. It’s just that there is quite a bit of code that needs to be replaced, so it will take some time.