Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Feb 20, 2024
1 parent 81d9d3c commit dc69e71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ jobs:
echo "Version: ${{ steps.info.outputs.version }}" >> deb/DEBIAN/control
echo "Architecture: ${{ steps.arch.outputs.arch }}" >> deb/DEBIAN/control
echo "Maintainer: chenmozhijin" >> deb/DEBIAN/control
echo "Depends: libxcb-cursor-dev"
echo "Description: lyrics tool" >> deb/DEBIAN/control
echo "[Desktop Entry]" >> deb/usr/share/applications/LDDC.desktop
Expand Down
9 changes: 8 additions & 1 deletion data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import os
import sqlite3
import sys

from PySide6.QtCore import QMutex

Expand All @@ -12,7 +13,13 @@ class Data:

def __init__(self, current_directory: str, mutex: QMutex) -> None:
self.mutex = mutex
self.db_path = os.path.join(current_directory, "data.db")

match sys.platform:
case "linux" | "darwin":
self.db_path = os.path.join(os.path.expanduser("~"), ".config/lddc/data.db")
case "win32":
self.db_path = os.path.join(current_directory, "data.db")

self.db_version = 1
try:
self.conn = sqlite3.connect(self.db_path)
Expand Down

0 comments on commit dc69e71

Please sign in to comment.