Skip to content

Commit

Permalink
- Fixed videos not working
Browse files Browse the repository at this point in the history
- Added comment count, fave count, upvotes, downvotes, and overall score to the details panel
- Details panel now opens by tapping the up arrow instead of swiping, to not conflict with gestures
- Removed the V1 API files
- Added rudimentary sorting options
- Fixed header image not randomizing
  • Loading branch information
Atulin committed Nov 8, 2020
1 parent 27a532c commit e1d003f
Show file tree
Hide file tree
Showing 12 changed files with 645 additions and 695 deletions.
276 changes: 0 additions & 276 deletions lib/API/v1/API.dart

This file was deleted.

36 changes: 0 additions & 36 deletions lib/API/v1/ImageList.dart

This file was deleted.

35 changes: 34 additions & 1 deletion lib/API/v2/API.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import 'dart:convert';

import 'package:chryssibooru/Helpers.dart';

Derpibooru derpibooruFromJson(String str) {
final jsonData = json.decode(str);
return Derpibooru.fromJson(jsonData);
Expand Down Expand Up @@ -237,7 +239,9 @@ enum MimeType { IMAGE_PNG, IMAGE_JPEG, VIDEO_WEBM, VIDEO_MP4 }

final mimeTypeValues = EnumValues({
"image/jpeg": MimeType.IMAGE_JPEG,
"image/png": MimeType.IMAGE_PNG
"image/png": MimeType.IMAGE_PNG,
"video/webm": MimeType.VIDEO_WEBM,
"video/mp4": MimeType.VIDEO_MP4
});

class Representations {
Expand All @@ -261,6 +265,35 @@ class Representations {
this.thumbTiny,
});

String fromEnum(ERepresentations representation) {
switch (representation) {
case ERepresentations.Full:
return this.full;
break;
case ERepresentations.Large:
return this.large;
break;
case ERepresentations.Medium:
return this.medium;
break;
case ERepresentations.Small:
return this.small;
break;
case ERepresentations.Thumb:
return this.thumb;
break;
case ERepresentations.ThumbSmall:
return this.thumbSmall;
break;
case ERepresentations.ThumbTiny:
return this.thumbTiny;
break;
default:
return this.thumbTiny;
break;
}
}

factory Representations.fromRawJson(String str) => Representations.fromJson(json.decode(str));

String toRawJson() => json.encode(toJson());
Expand Down
Loading

0 comments on commit e1d003f

Please sign in to comment.