Skip to content

Commit

Permalink
version bump and fix img upload
Browse files Browse the repository at this point in the history
  • Loading branch information
0312birdzhang committed Oct 1, 2021
1 parent 406c0e6 commit 30c9690
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
13 changes: 7 additions & 6 deletions harbour-sailfishclub.desktop
@@ -1,11 +1,12 @@
[X-Sailjail]
OrganizationName=club.sailfishos
ApplicationName=sailfishclub
Permissions=Pictures;Thumbnails;Audio;Internet;MediaIndexing;Sharing;WebView;Video;sailfish-browser;Notifications;

[Desktop Entry]
X-Nemo-Application-Type=silica-qt5
Type=Application
Icon=harbour-sailfishclub
Exec=harbour-sailfishclub
Name=SailfishClub
Name[zh]=旗鱼俱乐部
Name[zh]=旗鱼俱乐部

[X-Sailjail]
OrganizationName=club.sailfishos
ApplicationName=sailfishclub
Permissions=Pictures;Thumbnails;Audio;Internet;MediaIndexing;Sharing;WebView;Video;sailfish-browser;Notifications;
2 changes: 0 additions & 2 deletions py/app.py
Expand Up @@ -36,8 +36,6 @@

HARBOUR_APP_NAME = 'sailfishclub'
OrganizationName = 'club.sailfishos'
# /home/defaultuser/.local/share/club.sailfishos/sailfishclub
# /home/defaultuser/.cache/club.sailfishos/sailfishclub
HOME = os.path.expanduser('~')
XDG_DATA_HOME = os.environ.get('XDG_DATA_HOME', os.path.join(HOME, '.local', 'share'))
XDG_CONFIG_HOME = os.environ.get('XDG_CONFIG_HOME', os.path.join(HOME, '.config'))
Expand Down
8 changes: 4 additions & 4 deletions py/main.py
Expand Up @@ -20,7 +20,6 @@
console_handler.formatter = formatter
logger.addHandler(console_handler)
logger.setLevel(logging.DEBUG)
UnOfficalBlogURL = "https://notexists.top/api/post"
savePath = os.path.join(HOME, "Pictures","SailfishClub")
max_token_size = 4
# siteUrl = 'https://sailfishos.club'
Expand All @@ -45,13 +44,14 @@ def validate(uid, token, username):


def uploadImgQiyu(path):
domain = "https://img.qiyuos.cn"
url = '%s/upload' % (domain, )
domain = "http://159.75.45.226"
url = '%s:8082/upload' % (domain, )
visturl = '%s:8083' % (domain, )
try:
files = {'file' : open(path, 'rb')}
r = requests.post(url, files = files, timeout=5.0)
# {"code":200,"msg":"","data":"logo.png"}
return "%s%s" % (domain, r.json().get("msg"))
return "%s%s" % (visturl, r.json().get("msg"))
except Exception as e:
logger.error(str(e))
return None
Expand Down
2 changes: 1 addition & 1 deletion qml/harbour-sailfishclub.qml
Expand Up @@ -511,7 +511,7 @@ ApplicationWindow
//上传图片到niupic.com
function uploadImage(path,desc){
loading = true;
call('main.uploadNiuPic',[path],function(ret){
call('main.uploadImgQiyu',[path],function(ret){
loading = false;
//替换反斜线
if(ret)ret = ret.replace(/\\/g,"");
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/AboutPage.qml
Expand Up @@ -36,7 +36,7 @@ Page{
Label{
id:version
anchors.horizontalCenter: parent.horizontalCenter
text:qsTr("Version")+" 0.4.2"
text:qsTr("Version")+" 0.4.3"
}
Item{width: 1;height: Theme.paddingMedium}

Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-sailfishclub.spec
Expand Up @@ -14,7 +14,7 @@ Name: harbour-sailfishclub
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: SailfishClub client for Sailfish OS
Version: 0.4.2
Version: 0.4.3
Release: 1
Group: Qt/Qt
License: GPLv3
Expand Down
4 changes: 2 additions & 2 deletions src/settings.cpp
Expand Up @@ -3,7 +3,7 @@


SettingsObject::SettingsObject() {
settings = new QSettings("harbour-sailfishclub","harbour-sailfishclub");
settings = new QSettings("club.sailfishos","sailfishclub");
}


Expand Down Expand Up @@ -71,4 +71,4 @@ void SettingsObject::set_savetime(const QString &savetime) {

QString SettingsObject::get_savetime() {
return settings->value(QString("logindata/savetime"),QString("1548867120")).toString();
}
}

0 comments on commit 30c9690

Please sign in to comment.