Processing of mediaThumbnail and mediaDescription for Nextcloud feeds (#831)
* Processing of mediaThumbnail as first enclosure and mediaDescription as replacement content in Nextcloud feeds. * Formatting Next time, make sure to use ClangFormat to format the file. https://github.com/martinrotter/rssguard/blob/master/.clang-format Co-authored-by: martinrotter <martinrotter@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									9fff2feac5
								
							
						
					
					
						commit
						46ce39266f
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		|  | @ -587,6 +587,21 @@ QList<Message> OwnCloudGetMessagesResponse::messages() const { | ||||||
|     msg.m_customHash = message_map[QSL("guidHash")].toString(); |     msg.m_customHash = message_map[QSL("guidHash")].toString(); | ||||||
|     msg.m_rawContents = QJsonDocument(message_map).toJson(QJsonDocument::JsonFormat::Compact); |     msg.m_rawContents = QJsonDocument(message_map).toJson(QJsonDocument::JsonFormat::Compact); | ||||||
| 
 | 
 | ||||||
|  |     // In case body is empty, check for content in mediaDescription if item is available.
 | ||||||
|  |     if (msg.m_contents.isEmpty() && !message_map[QSL("mediaDescription")].isUndefined()) { | ||||||
|  |       msg.m_contents = message_map[QSL("mediaDescription")].toString(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // Check for mediaThumbnail and append as first enclosure to be viewed in internal viewer.
 | ||||||
|  |     if (!message_map[QSL("mediaThumbnail")].isUndefined()) { | ||||||
|  |       Enclosure enclosure; | ||||||
|  | 
 | ||||||
|  |       enclosure.m_mimeType = QSL("image/jpg"); | ||||||
|  |       enclosure.m_url = message_map[QSL("mediaThumbnail")].toString(); | ||||||
|  | 
 | ||||||
|  |       msg.m_enclosures.append(enclosure); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     QString enclosure_link = message_map[QSL("enclosureLink")].toString(); |     QString enclosure_link = message_map[QSL("enclosureLink")].toString(); | ||||||
| 
 | 
 | ||||||
|     if (!enclosure_link.isEmpty()) { |     if (!enclosure_link.isEmpty()) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue