diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86faceb..591ee36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,7 @@ jobs: run: | chmod +x history.sh output=$(./history.sh) - trimmed_output=$(echo "$output" | awk '{$1=$1};1') - echo "::set-output name=history::$trimmed_output" + echo "$output" > history.md - name: Create Release id: create_release @@ -55,7 +54,7 @@ jobs: release_name: Release ${{ github.ref }} draft: false prerelease: false - body: ${{ steps.get_history.outputs.history }} + body_path: history.md - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -65,4 +64,19 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ steps.sign_app.outputs.signedReleaseFile }} asset_name: my-tv-0-${{ github.ref_name }}.apk - asset_content_type: application/vnd.android.package-archive \ No newline at end of file + asset_content_type: application/vnd.android.package-archive + + - name: Gitee Create Release + run: | + latest_commit=$(git rev-parse HEAD) + history=$(cat history.md) + curl -v POST https://gitee.com/api/v5/repos/${{ github.repository }}/releases \ + -H "Content-Type: application/json" \ + -d '{ + "access_token": "${{ secrets.GITEE_ACCESS_TOKEN}}", + "tag_name": "${{ github.ref_name }}", + "name": "Release ${{ github.ref_name }}", + "body": "'"$history"'", + "prerelease": false, + "target_commitish": "'"$latest_commit"'" + }' \ No newline at end of file diff --git a/app/src/main/java/com/lizongying/mytv0/MainActivity.kt b/app/src/main/java/com/lizongying/mytv0/MainActivity.kt index e1a3f8a..d21b86a 100644 --- a/app/src/main/java/com/lizongying/mytv0/MainActivity.kt +++ b/app/src/main/java/com/lizongying/mytv0/MainActivity.kt @@ -88,6 +88,8 @@ class MainActivity : FragmentActivity() { View.SYSTEM_UI_FLAG_IMMERSIVE } + window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) + setContentView(R.layout.activity_main) if (savedInstanceState == null) { diff --git a/app/src/main/java/com/lizongying/mytv0/SimpleServer.kt b/app/src/main/java/com/lizongying/mytv0/SimpleServer.kt index 4985bbf..9868681 100644 --- a/app/src/main/java/com/lizongying/mytv0/SimpleServer.kt +++ b/app/src/main/java/com/lizongying/mytv0/SimpleServer.kt @@ -92,7 +92,8 @@ class SimpleServer(private val context: Context, port: Int) : NanoHTTPD(port) { val map = HashMap() session.parseBody(map) map["postData"]?.let { - val uri = Uri.parse(Gson().fromJson(it, UriResponse::class.java).uri) + val url = Utils.formatUrl(Gson().fromJson(it, UriResponse::class.java).uri) + val uri = Uri.parse(url) Log.i(TAG, "uri $uri") handler.post { TVList.parseUri(uri) diff --git a/app/src/main/java/com/lizongying/mytv0/models/TVList.kt b/app/src/main/java/com/lizongying/mytv0/models/TVList.kt index 8e2d379..66fea51 100644 --- a/app/src/main/java/com/lizongying/mytv0/models/TVList.kt +++ b/app/src/main/java/com/lizongying/mytv0/models/TVList.kt @@ -280,7 +280,6 @@ object TVList { } fun setPosition(position: Int): Boolean { - Log.i(TAG, "setPosition $position/${size()} ${getTVModel(position).tv.title} ${getTVModel(position).like.value}") if (position >= size()) { return false } diff --git a/history.sh b/history.sh old mode 100644 new mode 100755