Selaa lähdekoodia

Add author email

Billy Barrow 2 vuotta sitten
vanhempi
sitoutus
72401a5095
2 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 11 1
      src/lib/Metadata.vala
  2. 1 1
      src/tools/viewer/meson.build

+ 11 - 1
src/lib/Metadata.vala

@@ -46,7 +46,17 @@ namespace Ppub {
 
         public string? author_name {
             owned get {
-                return author?.split("<", 1)[0].chomp();
+                return author?.split("<")[0].chomp();
+            }
+        }
+
+        public string? author_email {
+            owned get {
+                var email = author?.split("<");
+                if(email == null || email.length != 2) {
+                    return null;
+                }
+                return email[1].split(">")[0];
             }
         }
 

+ 1 - 1
src/tools/viewer/meson.build

@@ -13,4 +13,4 @@ dependencies = [
     ppub_dep
 ]
 
-executable('GtkCommonMarkViewer', sources, dependencies: dependencies)
+executable('ppub-viewer-simple', sources, dependencies: dependencies)