mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-20 20:24:52 +00:00
Add support for Google Brews.
This commit is contained in:
@@ -116,6 +116,7 @@ GoogleActions = {
|
||||
updatedAt : file.modifiedTime,
|
||||
gDrive : true,
|
||||
googleId : file.id,
|
||||
pageCount : file.properties?.pageCount || 1,
|
||||
|
||||
title : file.properties.title,
|
||||
description : file.description,
|
||||
@@ -160,7 +161,9 @@ GoogleActions = {
|
||||
version : brew.version,
|
||||
renderer : brew.renderer,
|
||||
tags : brew.tags,
|
||||
systems : brew.systems.join() }
|
||||
systems : brew.systems.join(),
|
||||
pageCount : (brew.text.match(/\\page/g) || []).length + 1
|
||||
}
|
||||
},
|
||||
media : { mimeType : 'text/plain',
|
||||
body : brew.text }
|
||||
@@ -193,7 +196,8 @@ GoogleActions = {
|
||||
'shareId' : nanoid(12),
|
||||
'editId' : nanoid(12),
|
||||
'title' : brew.title,
|
||||
'views' : '0'
|
||||
'views' : '0',
|
||||
'pageCount' : (brew.text.match(/\\page/g) || []).length + 1
|
||||
}
|
||||
};
|
||||
|
||||
@@ -227,6 +231,7 @@ GoogleActions = {
|
||||
updatedAt : new Date(),
|
||||
gDrive : true,
|
||||
googleId : obj.data.id,
|
||||
pageCount : fileMetadata.properties.pageCount || 1,
|
||||
|
||||
title : brew.title,
|
||||
description : brew.description,
|
||||
@@ -298,6 +303,7 @@ GoogleActions = {
|
||||
createdAt : obj.data.createdTime,
|
||||
updatedAt : obj.data.modifiedTime,
|
||||
lastViewed : obj.data.properties.lastViewed,
|
||||
pageCount : obj.data.properties?.pageCount || 1,
|
||||
views : parseInt(obj.data.properties.views) || 0, //brews with no view parameter will return undefined
|
||||
version : parseInt(obj.data.properties.version) || 0,
|
||||
renderer : obj.data.properties.renderer ? obj.data.properties.renderer : 'legacy',
|
||||
|
||||
Reference in New Issue
Block a user