fix: update poll data extraction logic to ensure both question and options are present

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Sarto
2026-04-26 17:38:40 +03:30
parent 2e9bd4df03
commit 2fe3c8b604
2 changed files with 13 additions and 12 deletions
+10 -8
View File
@@ -84,7 +84,9 @@ jobs:
LDFLAGS="-s -w -X github.com/sartoopjj/thefeed/internal/version.Version=${VERSION} -X github.com/sartoopjj/thefeed/internal/version.Commit=${COMMIT} -X github.com/sartoopjj/thefeed/internal/version.Date=${DATE}"
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
if [ "${{ matrix.android_arm }}" = "true" ]; then
if [ "${{ matrix.goos }}" = "android" ] && [ "${{ matrix.goarch }}" = "arm64" ]; then
out="build/thefeed-client-android-arm64"
elif [ "${{ matrix.android_arm }}" = "true" ]; then
out="build/thefeed-client-android-arm"
else
out="build/thefeed-client-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}${ext}"
@@ -121,11 +123,11 @@ jobs:
- name: Stage Android client binary as JNI library
run: |
mkdir -p android/app/src/main/jniLibs/arm64-v8a
mkdir -p android/app/src/main/jniLibs/armeabi-v7a
# mkdir -p android/app/src/main/jniLibs/armeabi-v7a
test -f artifacts/thefeed-client-android-arm64
test -f artifacts/thefeed-client-android-arm
# test -f artifacts/thefeed-client-android-arm
cp artifacts/thefeed-client-android-arm64 android/app/src/main/jniLibs/arm64-v8a/libthefeed.so
cp artifacts/thefeed-client-android-arm android/app/src/main/jniLibs/armeabi-v7a/libthefeed.so
# cp artifacts/thefeed-client-android-arm android/app/src/main/jniLibs/armeabi-v7a/libthefeed.so
- name: Decode signing keystore
env:
@@ -161,8 +163,8 @@ jobs:
APK_DIR=app/build/outputs/apk/$BT
cp "$APK_DIR"/app-arm64-v8a-${BT}.apk ../artifacts/thefeed-android-arm64.apk
cp "$APK_DIR"/app-armeabi-v7a-${BT}.apk ../artifacts/thefeed-android-arm.apk
cp "$APK_DIR"/app-universal-${BT}.apk ../artifacts/thefeed-android-universal.apk
# cp "$APK_DIR"/app-armeabi-v7a-${BT}.apk ../artifacts/thefeed-android-arm.apk
# cp "$APK_DIR"/app-universal-${BT}.apk ../artifacts/thefeed-android-universal.apk
- name: Upload Android APK artifacts
uses: actions/upload-artifact@v4
@@ -170,8 +172,8 @@ jobs:
name: thefeed-android-apk
path: |
artifacts/thefeed-android-arm64.apk
artifacts/thefeed-android-arm.apk
artifacts/thefeed-android-universal.apk
# artifacts/thefeed-android-arm.apk
# artifacts/thefeed-android-universal.apk
release:
needs: [build, android-apk]
+3 -4
View File
@@ -540,13 +540,12 @@ func extractPollData(n *html.Node) string {
}
}
})
if question == "" && len(options) == 0 {
// Only return poll if both question and at least one option exist
if question == "" || len(options) == 0 {
return ""
}
result := "📊 " + question
if len(options) > 0 {
result += "\n" + strings.Join(options, "\n")
}
result += "\n" + strings.Join(options, "\n")
return result
}