After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769350 - desktop: Desktop games should have a cover
desktop: Desktop games should have a cover
Status: RESOLVED OBSOLETE
Product: gnome-games
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on: 769349
Blocks: 780852
 
 
Reported: 2016-07-31 10:46 UTC by Adrien Plazas
Modified: 2021-04-03 09:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display a cover for desktop games (1.89 KB, patch)
2017-03-30 13:25 UTC, Yasitha Rajapaksha
none Details | Review
desktop:Get the cover via Grillo (1.66 KB, patch)
2017-04-02 15:13 UTC, Yasitha Rajapaksha
none Details | Review
desktop:Get the cover via Grilo (2.48 KB, patch)
2017-04-05 12:57 UTC, Yasitha Rajapaksha
none Details | Review
desktop:Add brandnew DesktopUid class (2.46 KB, patch)
2017-04-05 18:43 UTC, Yasitha Rajapaksha
none Details | Review
desktop: Add brandnew DesktopUid class (1.04 KB, patch)
2017-04-05 20:04 UTC, Yasitha Rajapaksha
none Details | Review
desktop:Get the cover via Grilo (1.76 KB, patch)
2017-04-05 20:15 UTC, Yasitha Rajapaksha
none Details | Review
desktop: Add DesktopUid class (1.49 KB, patch)
2017-04-09 09:00 UTC, Yasitha Rajapaksha
none Details | Review
desktop: Get the cover via Grilo (1.34 KB, patch)
2017-04-09 09:06 UTC, Yasitha Rajapaksha
reviewed Details | Review
desktop: Add DesktopUid class (1.49 KB, patch)
2017-04-12 13:30 UTC, Yasitha Rajapaksha
none Details | Review
desktop: Add DesktopUid class (1.49 KB, patch)
2017-04-12 13:31 UTC, Yasitha Rajapaksha
none Details | Review

Description Adrien Plazas 2016-07-31 10:46:21 UTC
We should display a cover for desktop games as we do for many other ones.
Comment 1 Yasitha Rajapaksha 2017-03-30 13:25:19 UTC
Created attachment 348993 [details] [review]
display a cover for desktop games

desktop games do not display a cover
like they do in many other platforms

to fix this desktop game's title,icon
and mime type were used to generate a
cover through grillo
Comment 2 Adrien Plazas 2017-04-02 06:28:22 UTC
Review of attachment 348993 [details] [review]:

Can you link the bug adding PC support to the thegamesdb Grilo plugin?

Please read this https://wiki.gnome.org/Git/CommitMessages. :) You should tag the shortlog with the affected module and start it with a capital. Something like this for example: "desktop: Get the cover via Grilo"

For the rest of the message: no need to re-write what the bug is saying. The typical format is:
- if the shortlog doesn't already explain all that is important, add a paragraph describing the changes made to the code;
- if the reasoning of the changes isn't obvious, add a paragraph explaining why we need this change.

Here explaining that you use a GriloCover with the Desktop Entry mime type for desktop games would be sufficient.

::: plugins/desktop/src/desktop-plugin.vala
@@ +9,3 @@
 		return source;
 	}
+

We don't need this new line. :)

::: plugins/desktop/src/desktop-tracker-query.vala
@@ +53,3 @@
+		var media = new GriloMedia (title, MIME_TYPE));
+		var cover = new CompositeCover ({
+			new LocalCover (uri),

I'm not sure local covers make sense for desktop games… maybe just having a GriloCover is better. :o
Comment 3 Adrien Plazas 2017-04-02 06:28:53 UTC
Review of attachment 348993 [details] [review]:

.
Comment 4 Yasitha Rajapaksha 2017-04-02 15:13:25 UTC
Created attachment 349141 [details] [review]
desktop:Get the cover via Grillo

Using a Grillo cover with the Desktop
Entry mime type for desktop games
Comment 5 Yasitha Rajapaksha 2017-04-02 20:30:38 UTC
Adding PC support to the thegamesdb Grilo plugin

https://bugzilla.gnome.org/show_bug.cgi?id=780852
Comment 6 Adrien Plazas 2017-04-03 07:54:54 UTC
Review of attachment 349141 [details] [review]:

It's Grilo with one l. :)

Again, lines should feel as much as possible of the allowed 72 chars.

::: plugins/desktop/src/desktop-tracker-query.vala
@@ +58,3 @@
 		var runner = new CommandRunner (args, true);
 
+		games += new GenericGame (title, icon, media, runner);

I'm pretty sure this doesn't compile…
Comment 7 Yasitha Rajapaksha 2017-04-05 12:57:54 UTC
Created attachment 349297 [details] [review]
desktop:Get the cover via Grilo

Using a Grilo cover with the Desktop Entry mime type for desktop games.
New DesktopUid class gets the id via DesktopAppInfo and pass to grilo
to get the cover.
Comment 8 Yasitha Rajapaksha 2017-04-05 13:00:06 UTC
Couldn't test this due to an issue in my build.
Comment 9 Adrien Plazas 2017-04-05 13:13:53 UTC
Review of attachment 349297 [details] [review]:

Here we are doing two sequential but not really related things: we add the UID and we use it to get covers. It would be better to first add the UID in its own commit (as a reasoning for the addition, you could say that it will be used in the next commit), then to enable the covers in the second commit.

That being said, globally the patch looks good. :)

::: plugins/desktop/src/Makefile.am
@@ +35,3 @@
 	desktop-title.vala \
 	desktop-tracker-query.vala \
+    desktop-uid.vala\

Indentation is wrong: use a tab. Also a space is missing before the \.

::: plugins/desktop/src/desktop-tracker-query.vala
@@ +52,3 @@
+		var uid = new DesktopUid (app_info);
+		var media = new GriloMedia (title, MIME_TYPE);	
+        var cover = new GriloCover (media, uid);	

Ditto: use tabs.

::: plugins/desktop/src/desktop-uid.vala
@@ +9,3 @@
+
+	public string get_uid () throws Error {
+		return app_info.get_id ();

This is good, but I would prefer to `return @"desktop-$(app_info.get_id ())";` for consistency with the other UIDs.
Comment 10 Yasitha Rajapaksha 2017-04-05 18:43:20 UTC
Created attachment 349319 [details] [review]
desktop:Add brandnew DesktopUid class

New DesktopUid class gets the id via DesktopAppInfo and pass to grilo
to get the cover.This will be used in next commit.
Comment 11 Yasitha Rajapaksha 2017-04-05 20:04:42 UTC
Created attachment 349331 [details] [review]
desktop: Add brandnew DesktopUid class

New DesktopUid class gets the id via DesktopAppInfo and pass to grilo
to get the cover.This will be used in next commit.
Comment 12 Yasitha Rajapaksha 2017-04-05 20:15:23 UTC
Created attachment 349332 [details] [review]
desktop:Get the cover via Grilo

Using a Grilo cover with the Desktop Entry mime type for desktop games.
Comment 13 Adrien Plazas 2017-04-07 12:38:03 UTC
Review of attachment 349331 [details] [review]:

This code looks very good but I'm not sure the UID is constructed how we want it.

Take hedgewars.desktop, its ID would be hedgewars.desktop, hence the UID would be desktop-hedgewars.desktop. The repetition of "desktop" isn't a big deal but the ID shouldn't be used as a file name because of its suffix, also it would break the consistency with the other UIDs which use only lower case ASCII letters, digits and the - character.

We could try to remove the ".desktop" part or maybe better: hash the original ID with SHA256 to have something like "desktop-061f5c017b31fe8530f062be4cf141c4908d0d17bb8a9dea80e0980a3792451d" for the ID "hedgewars.desktop".

Any thought about that? :o

Regarding the commit message: "brandnew" is useless here, and the message doesn't really describe what this patch does, all it does is to add the class, right now it sounds like this precise commit is retrieving the cover via Grilo.
Comment 14 Yasitha Rajapaksha 2017-04-09 09:00:59 UTC
Created attachment 349550 [details] [review]
desktop: Add DesktopUid class

New DesktopUid class returns the id in SHA-256.This will be used in
next commit.
Comment 15 Yasitha Rajapaksha 2017-04-09 09:06:29 UTC
Created attachment 349551 [details] [review]
desktop: Get the cover via Grilo

Using a Grilo cover with the Desktop Entry mime type for desktop games.
Comment 16 Adrien Plazas 2017-04-11 13:40:41 UTC
Review of attachment 349550 [details] [review]:

A space is missing before "This" in the commit message.

Except very tiny stylistic errors, the code is good! :) I'll accept the patch once they are fixed and one we are sure the patch works.

::: plugins/desktop/src/desktop-uid.vala
@@ +10,3 @@
+
+	public string get_uid () throws Error {
+		uid = Checksum.compute_for_string (ChecksumType.SHA256, app_info.get_id(), -1);

No need to pass the optional -1 param here. Also return statements (and all sequence breaking statements, actually) should have an empty line before them so they pop out more.

@@ +11,3 @@
+	public string get_uid () throws Error {
+		uid = Checksum.compute_for_string (ChecksumType.SHA256, app_info.get_id(), -1);
+		return @"desktop-$(uid)";

No need for parenthesis for params which are just one word, so just $uid is fine here. :)
Comment 17 Adrien Plazas 2017-04-11 13:41:39 UTC
Review of attachment 349551 [details] [review]:

LGTM, I'll accept it once we check its works as expected and the errors we have are external.
Comment 18 Yasitha Rajapaksha 2017-04-12 13:30:03 UTC
Created attachment 349729 [details] [review]
desktop: Add DesktopUid class

New DesktopUid class returns the id in SHA-256.This was used in last
commit.
Comment 19 Yasitha Rajapaksha 2017-04-12 13:31:51 UTC
Created attachment 349730 [details] [review]
desktop: Add DesktopUid class

New DesktopUid class returns the id in SHA-256. This was used in last
commit.
Comment 20 Alexander Mikhaylenko 2018-08-25 15:59:58 UTC
The `DesktopUid` part of this was implemented separarately in https://gitlab.gnome.org/GNOME/gnome-games/merge_requests/54 and https://gitlab.gnome.org/GNOME/gnome-games/merge_requests/109. The remaining part is still relevant, except it probably needs a different MIME type.
Comment 21 Alexander Mikhaylenko 2021-04-03 09:58:54 UTC
We'll remove desktop platform this cycle, closing.