예제 #1
0
def FindDuplicates(dodelete):
    dupvids = []
    vids = sorted(Video.getAllEntries(), key=lambda v: v.hash)

    for i in range(len(vids)-1):
        if vids[i].hash == 'NULL':
            continue
        if vids[i].hash == vids[i+1].hash:
            dupvids.append(vids[i+1])

    if dodelete:
        for vid in dupvids:
            vid.delete()

    return dupvids
def FindDuplicates(dodelete):
    dupvids = []
    vids = sorted(Video.getAllEntries(), key=lambda v: v.hash)

    for i in range(len(vids)-1):
        if vids[i].hash == 'NULL':
            continue
        if vids[i].hash == vids[i+1].hash:
            dupvids.append(vids[i+1])

    if dodelete:
        for vid in dupvids:
            vid.delete()

    return dupvids
예제 #3
0
 def getAll(self):
     for vid in Video.getAllEntries(db=self.db):
         self.add(vid)
예제 #4
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#---------------------------
# Name: hash_videos.py
# Python Script
# Author: Raymond Wagner
# Purpose
#   This script will regenerate the hash values associated with
#   videos in the MythVideo database.
#---------------------------

from MythTV import Video

QUIET = True


def print_aligned(left, right):
    indent = 100 - len(left)
    print left, indent * ' ', right


for vid in Video.getAllEntries():
    if vid.hash in ('NULL', '', 'UNKNOWN_COMMAND'):
        vid.hash = vid.getHash()
        vid.update()
        print_aligned(vid.filename, vid.hash)
    elif not QUIET:
        print_aligned(vid.filename, 'skipped')
예제 #5
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#---------------------------
# Name: hash_videos.py
# Python Script
# Author: Raymond Wagner
# Purpose
#   This script will regenerate the hash values associated with
#   videos in the MythVideo database.
#---------------------------

from MythTV import Video

QUIET = True

def print_aligned(left, right):
    indent = 100 - len(left)
    print left, indent*' ', right

for vid in Video.getAllEntries():
    if vid.hash in ('NULL', '', 'UNKNOWN_COMMAND'):
        vid.hash = vid.getHash()
        vid.update()
        print_aligned(vid.filename, vid.hash)
    elif not QUIET:
        print_aligned(vid.filename, 'skipped')

예제 #6
0
 def getAll(self):
     for vid in Video.getAllEntries(db=self.db):
         self.add(vid)