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 741162 - media-server: Store photo names without extensions
media-server: Store photo names without extensions
Status: RESOLVED FIXED
Product: gnome-online-miners
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Online Miners maintainer(s)
GNOME Online Miners maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-12-05 13:32 UTC by Pranav Kant
Modified: 2014-12-16 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
media-server: Store photo names without extensions (2.16 KB, patch)
2014-12-05 13:32 UTC, Pranav Kant
needs-work Details | Review
media-server: Store photo names without extensions (2.20 KB, patch)
2014-12-16 14:17 UTC, Debarshi Ray
committed Details | Review

Description Pranav Kant 2014-12-05 13:32:29 UTC
The DisplayName property from the media server returns the filename with
extensions of photos. We don't need to store extensions of photos in nie:title.
Comment 1 Pranav Kant 2014-12-05 13:32:34 UTC
Created attachment 292183 [details] [review]
media-server: Store photo names without extensions
Comment 2 Debarshi Ray 2014-12-16 13:56:08 UTC
Review of attachment 292183 [details] [review]:

Thanks for the patch, Pranav. Looks good, apart from a small issue.

::: src/gom-media-server-miner.c
@@ +59,1 @@
   photo->name = g_strdup (str);

This introduces a leak because gom_filename_strip_extension returns a string that the caller needs to g_free. I would suggest directly assigning the returned string to photo->name.

::: src/gom-utils.c
@@ +69,3 @@
+  return filename;
+}
+

You get bonus points for having taken the implementation from gnome-documents / gnome-photos.
Comment 3 Debarshi Ray 2014-12-16 14:10:34 UTC
Review of attachment 292183 [details] [review]:

::: src/gom-utils.h
@@ +31,3 @@
 const gchar *gom_filename_to_rdf_type (const gchar *filename_with_extension);
 
+const gchar *gom_filename_strip_extension (const gchar *filename_with_extension);

The return type should not be const because the caller needs to g_free it.
Comment 4 Debarshi Ray 2014-12-16 14:17:49 UTC
Created attachment 292834 [details] [review]
media-server: Store photo names without extensions

Fixed the above issues.