Merge branch 'master' into 'develop'

chore(release): 1.6.0 [only cd]

See merge request sschueller/peertube!33
This commit is contained in:
Stefan Schüller 2021-11-20 23:45:43 +00:00
commit e540100216
8 changed files with 81 additions and 6 deletions

View File

@ -1,3 +1,10 @@
# 1.6.0 (2021-11-20)
### Features
* Load full description 2f89538
## 1.5.2 (2021-10-11)

View File

@ -1 +1 @@
1.5.2
1.6.0

View File

@ -46,8 +46,8 @@ android {
applicationId "net.schueller.peertube"
minSdkVersion 21
targetSdkVersion 29
versionCode 1063
versionName "1.5.2"
versionCode 1064
versionName "1.6.0"
buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -36,6 +36,7 @@ import android.widget.Toast;
import com.mikepenz.iconics.Iconics;
import com.squareup.picasso.Picasso;
import java.util.Objects;
import net.schueller.peertube.R;
import net.schueller.peertube.helper.APIUrlHelper;
import net.schueller.peertube.helper.ErrorHelper;
@ -43,6 +44,7 @@ import net.schueller.peertube.helper.MetaDataHelper;
import net.schueller.peertube.intents.Intents;
import net.schueller.peertube.model.Account;
import net.schueller.peertube.model.Avatar;
import net.schueller.peertube.model.Description;
import net.schueller.peertube.model.Rating;
import net.schueller.peertube.model.Video;
import net.schueller.peertube.network.GetVideoDataService;
@ -210,7 +212,29 @@ public class VideoMetaDataFragment extends Fragment {
// description
TextView videoDescription = activity.findViewById(R.id.description);
videoDescription.setText(video.getDescription());
String shortDescription = video.getDescription();
if (shortDescription != null && Objects.requireNonNull(shortDescription).length() > 237) {
shortDescription += "\n" + getString(R.string.video_description_read_more);
videoDescription.setOnClickListener(v -> {
Call<Description> call = videoDataService.getVideoFullDescription(video.getUuid());
call.enqueue(new Callback<Description>() {
@Override
public void onResponse(Call<Description> call, Response<Description> response) {
if (response.isSuccessful() && response.body() != null) {
new Description();
Description videoFullDescription;
videoFullDescription = response.body();
videoDescription.setText(videoFullDescription.getDescription());
}
}
@Override
public void onFailure(Call<Description> call, Throwable t) {
Toast.makeText(getContext(), getString(R.string.video_get_full_description_failed), Toast.LENGTH_SHORT).show();
}
});
});
}
videoDescription.setText(shortDescription);
// video privacy
TextView videoPrivacy = activity.findViewById(R.id.video_privacy);

View File

@ -0,0 +1,30 @@
/*
* Copyright (C) 2020 Stefan Schüller <sschueller@techdroid.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.schueller.peertube.model;
public class Description {
private String description;
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
}

View File

@ -16,6 +16,7 @@
*/
package net.schueller.peertube.network;
import net.schueller.peertube.model.Description;
import net.schueller.peertube.model.Rating;
import net.schueller.peertube.model.Video;
import net.schueller.peertube.model.VideoList;
@ -43,9 +44,9 @@ public interface GetVideoDataService {
@Query("languageOneOf") Set<String> languages
);
@GET("videos/{id}")
@GET("videos/{uuid}")
Call<Video> getVideoData(
@Path(value = "id", encoded = true) String id
@Path(value = "uuid", encoded = true) String id
);
@GET("search/videos/")
@ -64,6 +65,11 @@ public interface GetVideoDataService {
@Path(value = "id", encoded = true) Integer id
);
@GET("videos/{uuid}/description")
Call<Description> getVideoFullDescription(
@Path(value = "uuid", encoded = true) String id
);
@PUT("videos/{id}/rate")
Call<ResponseBody> rateVideo(
@Path(value = "id", encoded = true) Integer id,

View File

@ -364,4 +364,6 @@
<string name="pref_insecure_confirm_yes">Yes</string>
<string name="pref_insecure_confirm_message">You are about the disable all SSL Certification validation in Thorium. Disabling this can be very dangerous if the peertube server is not under your control, because a man-in-the-middle attack could direct traffic to another server without your knowledge. An attacker could record passwords and other personal data.</string>
<string name="video_list_live_marker">LIVE</string>
<string name="video_get_full_description_failed">Getting full video description failed</string>
<string name="video_description_read_more">Read More</string>
</resources>

View File

@ -0,0 +1,6 @@
# 1.6.0 (2021-11-20)
### Features
* Load full description 2f89538