Panel improvements
- Added progress meter for video and audio media types. - Changed the __repr__ method of a MediaEntry to display a bit more useful explanation. - Added a new MediaEntry.state, 'processing', which means that the task is running the processor on the item currently. - Fixed some PEP8 issues in user_pages/views.py - Fixed the ATOM TAG URI to show the correct year.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from sqlalchemy import MetaData, Table, Column, Boolean
|
||||
from sqlalchemy import MetaData, Table, Column, Boolean, SmallInteger
|
||||
|
||||
from mediagoblin.db.sql.util import RegisterMigration
|
||||
|
||||
@@ -47,3 +47,15 @@ def add_wants_notification_column(db_conn):
|
||||
default=True, nullable=True)
|
||||
col.create(users, populate_defaults=True)
|
||||
db_conn.commit()
|
||||
|
||||
|
||||
@RegisterMigration(3, MIGRATIONS)
|
||||
def add_transcoding_progress(db_conn):
|
||||
metadata = MetaData(bind=db_conn.bind)
|
||||
|
||||
media_entry = Table('core__media_entries', metadata, autoload=True,
|
||||
autoload_with=db_conn.bind)
|
||||
|
||||
col = Column('transcoding_progress', SmallInteger)
|
||||
col.create(media_entry)
|
||||
db_conn.commit()
|
||||
|
||||
@@ -107,6 +107,8 @@ class MediaEntry(Base, MediaEntryMixin):
|
||||
fail_error = Column(Unicode)
|
||||
fail_metadata = Column(JSONEncoded)
|
||||
|
||||
transcoding_progress = Column(SmallInteger)
|
||||
|
||||
queued_media_file = Column(PathTupleWithSlashes)
|
||||
|
||||
queued_task_id = Column(Unicode)
|
||||
@@ -209,6 +211,12 @@ class MediaEntry(Base, MediaEntryMixin):
|
||||
__import__(models_module)
|
||||
return sys.modules[models_module].DATA_MODEL
|
||||
|
||||
def __repr__(self):
|
||||
return '<{classname} {id}: {title}>'.format(
|
||||
classname=self.__class__.__name__,
|
||||
id=self.id,
|
||||
title=self.title)
|
||||
|
||||
|
||||
class FileKeynames(Base):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user