def get_unseen_likes():
 return frappe.db.sql(u"select count(*) from `tabCommunication`\n DCTB  DCTB where\n DCTB  DCTB  DCTB communication_type='Comment'\n DCTB  DCTB  DCTB and modified >= DATE_SUB(NOW(),INTERVAL 1 YEAR)\n DCTB  DCTB  DCTB and comment_type='Like'\n DCTB  DCTB  DCTB and owner is not null and owner!=%(user)s\n DCTB  DCTB  DCTB and reference_owner=%(user)s\n DCTB  DCTB  DCTB and seen=0", {u'user': frappe.session.user})[0][0]

def get_unseen_likes ( ) : return frappe . db . sql ( u"select count(*) from `tabCommunication`\n DCTB  DCTB where\n DCTB  DCTB  DCTB communication_type='Comment'\n DCTB  DCTB  DCTB and modified >= DATE_SUB(NOW(),INTERVAL 1 YEAR)\n DCTB  DCTB  DCTB and comment_type='Like'\n DCTB  DCTB  DCTB and owner is not null and owner!=%(user)s\n DCTB  DCTB  DCTB and reference_owner=%(user)s\n DCTB  DCTB  DCTB and seen=0" , { u'user' : frappe . session . user } ) [ 0 ] [ 0 ]
returns count of unseen likes .