Skip to content

Commit

Permalink
app: release fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pwd491 committed May 3, 2024
2 parents 046182b + 1328020 commit b8fd591
Show file tree
Hide file tree
Showing 19 changed files with 635 additions and 201 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cd Syncogram
flet pack application.py `
--name "Syncogram" `
--icon "assets\logo\ico\duck128x128.ico" `
--icon "assets/logo/icns/duck512x512.icns" `
--product-name "Syncogram Application" `
--product-version "${{ env.json_APP_VERSION }}" `
--company-name "Syncogram Application" `
Expand All @@ -52,8 +52,8 @@ jobs:
--add-binary locales:locales `
--add-data assets:assets `
--add-data config.json:. `
--distpath ..\craft
cd ..\
--distpath ../craft
cd ../
- name: Archive Windows Application
run: |
Expand Down
2 changes: 1 addition & 1 deletion Syncogram/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def application(page: ft.Page) -> None:
expand=True,
)
)
newest_version(page, cfg["APP"]["VERSION"], _)
newest_version(page, _)

if __name__ == "__main__":
ft.app(target=application, assets_dir="assets")
8 changes: 6 additions & 2 deletions Syncogram/config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"APP": {
"NAME": "Syncogram",
"VERSION": "2024.20.04",
"VERSION": "2024.03.05",
"VERSION_IS_ALPHA": "True",
"VERSION_IS_BETA": "False"
},
"DATABASE": {
"VERSION": "0.0.1"
},
"GIT": {
"REPO_LINK": "https://github.com/pwd491/syncogram.git",
"REPO_ISSUES": "https://github.com/pwd491/syncogram/issues",
"RELEASES": "https://github.com/pwd491/Syncogram/releases",
"BRANCH_MAIN": "master",
"BRANCH_SECOND": "dev"
"BRANCH_SECOND": "dev",
"REMOTE_CONFIG_URL": "https://raw.githubusercontent.com/pwd491/Syncogram/master/Syncogram/config.json"
},
"AUTHOR": {
"NAME": "Sergey Degtyar",
Expand Down
127 changes: 127 additions & 0 deletions Syncogram/sourcefiles/database/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
SQL_TABLE_USERS = \
"""
CREATE TABLE IF NOT EXISTS users
(
user_id INTEGER PRIMARY KEY,
is_primary INTEGER,
username VARCHAR(32),
phone VARCHAR(16),
first_name VARCHAR(64),
last_name VARCHAR(64),
restricted INTEGER,
restriction_reason TEXT,
stories_hidden INTEGER,
stories_unavailable INTEGER,
contact_require_premium INTEGER,
scam INTEGER,
fake INTEGER,
premium INTEGER,
photo INTEGER,
emoji_status TEXT,
usernames TEXT,
color TEXT,
profile_color TEXT,
session TEXT,
access_hash INTEGER
)
"""

SQL_TABLE_OPTIONS = \
"""
CREATE TABLE IF NOT EXISTS options
(
user_id INTEGER PREFERENCE UNIQUE,
is_sync_fav INTEGER DEFAULT 0,
is_sync_profile_name INTEGER DEFAULT 0
)
"""

SQL_UPDATE_OPTIONS = \
"""
UPDATE `options`
SET
is_sync_fav = (?),
is_sync_profile_name = (?)
FROM
(
SELECT user_id FROM users WHERE is_primary = 1
) as users
WHERE
(
options.user_id = users.user_id
)
"""

SQL_INSERT_OPTIONS = \
"""
INSERT INTO options
VALUES
(
(SELECT user_id FROM users WHERE is_primary = 1),
(?),
(?)
)
"""


SQL_TABLE_DB_DATA = \
"""
CREATE TABLE IF NOT EXISTS db_data (version VARCHAR)
"""

SQL_TRIGGER_DEFAULT_OPTIONS = \
"""
CREATE TRIGGER IF NOT EXISTS defaults_options_on_insert
AFTER INSERT ON users
BEGIN
INSERT INTO options
VALUES
(
NEW.user_id,
0,
0,
0
);
END;
"""

SQL_TRIGGER_DROP_OPTIONS = \
"""
CREATE TRIGGER IF NOT EXISTS delete_options_on_delete
BEFORE DELETE
ON users
BEGIN
DELETE FROM options
WHERE
(
old.user_id = options.user_id
);
END;
"""

SQL_ADD_USER = \
"""
INSERT INTO users
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
"""

SQL_GET_USERS = """SELECT * FROM users"""
SQL_GET_USER_ID_BY_STATUS = """SELECT user_id FROM users WHERE is_primary = (?) """
SQL_GET_USERNAME_BY_STATUS = """SELECT username FROM users WHERE is_primary = (?)"""
SQL_GET_SESSION_BY_ID = """SELECT session FROM users WHERE user_id = ?"""
SQL_GET_SESSION_BY_STATUS = """SELECT session FROM users WHERE is_primary = ?"""
SQL_DELETE_USER_BY_ID = """DELETE FROM users WHERE user_id = ?"""
SQL_DROP_OPTIONS = """DROP TABLE options"""
SQL_GET_DATABASE_VERSION = """SELECT version FROM db_data"""
SQL_INSERT_DB_VERSION = """INSERT INTO db_data VALUES (?)"""
SQL_UPDATE_DB_VERSION = """UPDATE db_data SET version = (?)"""

SQL_GET_OPTIONS = \
"""
SELECT *
FROM options
WHERE options.user_id =
(
SELECT user_id FROM users WHERE is_primary = 1
)
"""
44 changes: 0 additions & 44 deletions Syncogram/sourcefiles/database/consts.py

This file was deleted.

Loading

0 comments on commit b8fd591

Please sign in to comment.