Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: settings options #42

Merged
merged 2 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions server/css/video.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
position: absolute;
}

#video-screen #videoplayer.crop-simple {
object-fit: cover;
}

#video-screen #videoplayer.expand {
object-fit: fill;
}

#video-screen .osd {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -76,6 +84,8 @@
color: #fff;
font-size: 45px;
opacity: 0.5;
margin: 0 30px;
max-width: 35px;
}

#video-screen .osd .player-settings i.selected {
Expand Down
63 changes: 46 additions & 17 deletions server/js/core/mappers/crunchyroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ window.mapper = {
id: banner.panel.id,
title: banner.panel.title,
description: banner.panel.description,
background: banner.panel.images.poster_wide[0][4].source,
background: mapper.preventImageErrorTest(function () {
return banner.panel.images.poster_wide[0][4].source;
}),
},
lists: lists.map((list) => ({
title: list.title,
items: [],
})),
};

mapper.loaded = 0
mapper.loaded = 0;
for (var index = 0; index < lists.length; index++) {
mapper.load(lists[index], index, {
success: function (test, on) {
Expand All @@ -54,17 +56,23 @@ window.mapper = {
? item.panel.episode_metadata.series_title
: item.title;
description = item.panel ? item.panel.title : item.description;
background = item.panel
? item.panel.images.thumbnail[0][4].source
: item.images.thumbnail[0][4].source;
background = mapper.preventImageErrorTest(function () {
return item.panel
? item.panel.images.thumbnail[0][4].source
: item.images.thumbnail[0][4].source;
});
} else {
type = item.type;
display = "serie";
id = item.id;
title = item.title;
description = item.description;
background = item.images.poster_wide[0][5].source;
poster = item.images.poster_tall[0][2].source;
background = mapper.preventImageErrorTest(function () {
return item.images.poster_wide[0][5].source;
});
poster = mapper.preventImageErrorTest(function () {
return item.images.poster_tall[0][2].source;
});
}

return {
Expand Down Expand Up @@ -93,7 +101,9 @@ window.mapper = {
if (item.resource_type === "dynamic_collection") {
url = item.link;
} else {
url = `/content/v2/cms/objects/${item.ids.join()}?locale=${storage.account.language}`;
url = `/content/v2/cms/objects/${item.ids.join()}?locale=${
storage.account.language
}`;
}

var headers = new Headers();
Expand Down Expand Up @@ -123,7 +133,9 @@ window.mapper = {
season_number: item.panel.episode_metadata.season_number,
episode_number: item.panel.episode_metadata.episode_number,
description: item.panel.description,
background: item.panel.images.thumbnail[0][4].source,
background: mapper.preventImageErrorTest(function () {
return item.panel.images.thumbnail[0][4].source;
}),
watched: !item.never_watched,
playhead: Math.round(item.playhead / 60),
duration: Math.round(item.panel.episode_metadata.duration_ms / 60000),
Expand All @@ -150,9 +162,11 @@ window.mapper = {
description: episode.description,
number: episode.episode_number,
episode_number: episode.episode_number,
background: episode.images.thumbnail
? episode.images.thumbnail[0][1].source
: "",
background: mapper.preventImageErrorTest(function () {
return episode.images.thumbnail
? episode.images.thumbnail[0][1].source
: "";
}),
stream: episode.__links__.streams.href.substr(
episode.__links__.streams.href.indexOf("/videos/") + 8,
9
Expand Down Expand Up @@ -204,8 +218,12 @@ window.mapper = {
id: item.id,
title: item.title,
description: item.description,
background: item.images.poster_wide[0][5].source,
poster: item.images.poster_tall[0][2].source,
background: mapper.preventImageErrorTest(function () {
return item.images.poster_wide[0][5].source;
}),
poster: mapper.preventImageErrorTest(function () {
return item.images.poster_tall[0][2].source;
}),
})),
]
: acum,
Expand All @@ -229,9 +247,20 @@ window.mapper = {
? element.panel.episode_metadata.series_title
: element.title,
description: element.panel.title,
background: element.panel
? element.panel.images.thumbnail[0][4].source
: element.images.thumbnail[0][4].source,
background: mapper.preventImageErrorTest(function () {
return element.panel
? element.panel.images.thumbnail[0][4].source
: element.images.thumbnail[0][4].source;
}),
}));
},

preventImageErrorTest: function (callback, id) {
try {
return callback();
} catch (error) {
console.log(`error image #${id}`);
return `https://dummyimage.com/600x400/f48321/fff.png&text=IMAGE+${id}`;
}
},
};
1 change: 1 addition & 0 deletions server/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ window.main = {
session.clear();
login.init();
},

login: function () {
session.valid({
success: function () {
Expand Down
22 changes: 15 additions & 7 deletions server/js/screen/changelog.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
window.changelog = {
id: "changelog-modal",
data: {
version: "v1.1",
version: "v1.1.1",
changes: [
{
title: "feat: update changelogs",
description: "You will now receive a report like this with each update.",
title: "fix: home feed locale by @Shyked",
description: "Resolved language issues on home screen.",
},
{
title: "feat: skip intro beta version",
description: "Anime without delays! Skip the intro with just one button. More action, less waiting.",
title: "feat: update search screen by @GnarLito",
description: "Improved search display by adding names to identify anime.",
},
{
title: "fix: solve error when video versions is null",
description: "Playback issues have been resolved in certain anime titles, such as \"The Marginal Service\".",
title: "feat: logout button by @GnarLito",
description: "If you want, you can now log out of the application.",
},
{
title: "feat: video option next episode",
description: "next episode option on the video screen.",
},
{
title: "feat: video option aspect ratio",
description: "In some animes, you can customize the video's aspect ratio.",
},
],
extra: "If you have any issues or suggestions, you can report them on the GitHub jhassan8/crunchyroll-tizen.",
Expand Down
Loading